Questions tagged [nestjs-graphql]
43 questions
1
vote
0 answers
How to use nest js resolvefield and dataloader in nestjs/graphql?
I am facing two problems in using ResolveFeild decorator.
Here is my Category Entity-
@ObjectType()
export class Category {
@Field(() => ID, { nullable: false })
id: ObjectId;
@Field(() => String, { nullable: false })
name: string;
…

Samia Sammi
- 95
- 2
- 10
0
votes
1 answer
nestjs/graphql: How to return mixed array of values and nulls?
I'm using @nestjs/graphql to build graphql API. I have the following object
@ObjectType('Round')
export class RoundDto {
@Field(() => GraphQLInt)
round: number;
@Field(() => [[GraphQLString]])
teams: Nullable<[string, string]>[];
}
How Can…

Pavlo Naumenko
- 561
- 5
- 15
0
votes
0 answers
NestJS GraphQL auto-registration of interface fields when using interface resolvers doesn't work properly
I would like to use interface resolver as described in official documentation of NestJS and I have created following code to try it out.
Models are in file models.ts:
import { Field, ID, InterfaceType, ObjectType } from…

filipgl
- 1
0
votes
0 answers
NestJS Graphql subscription -- how to disconnect client?
I've been looking like mad trying to find some API documentation on how to do this.
I'm using 9x versions of nestjs with graphql-ws 5.11.2 and graphql-redis-subscriptions 2.5.0 and 16.5.0 graphql.
I'm doing the code first approach which has this…

SebastianG
- 8,563
- 8
- 47
- 111
0
votes
1 answer
Error: Nest can't resolve dependencies despite adding the module to imports
This is my owners.service.ts
import { Injectable } from '@nestjs/common'
import { CreateOwnerInput } from './dto/create-owner.input'
import { UpdateOwnerInput } from './dto/update-owner.input'
import { InjectRepository } from…

nikulas13
- 115
- 1
- 8
0
votes
0 answers
how to configure swagger with nestjs/graphql projects
I'm working on a project using NestJS and GraphQL, and I want to add Swagger documentation to my API endpoints. I have already set up GraphQL and it's working fine, but I'm not sure how to configure Swagger to generate the documentation for my…
0
votes
0 answers
How can I make a NestJS GraphQL request bypass the built-in exception filter and only use the global exception filter for error handling?
I'm currently working with NestJS and GraphQL, and I'm trying to handle all errors using a custom global exception filter that I've created. However, I've noticed that the built-in exception filter always handles and logs the errors before my custom…

YOSEPH NOH
- 87
- 4
0
votes
0 answers
Reusing models from NestJS GraphQL back-end using a library shared with front-end
I'm trying to export a model from a library to have a front-end app. It is a React app using ViteJS and Rollup.
How do you share your models between a NestJS GraphQL app and front-end app?
Shared library
Here is a simple Input I'm trying to reuse in…

Adrien Mangeot
- 21
- 6
0
votes
0 answers
Avoid children fields in parent interface in NestJS / GraphQL
I struggle to implement an interface with NestJS and GraphQL using code-first approach.
How come NestJS picks up on children fields to generate parent's interface schema?
Current schema
interface Report implements Node {
# Field from…

Adrien Mangeot
- 21
- 6
0
votes
1 answer
ApolloServerPluginLandingPageLocalDefault from @apollo/server is not compatible with NestJS GraphQLModule config
I am migrating my NestJS application from Apollo v3 to Apollo v4, but I encountered a problem.
Following the migration guide here
I modified the import statement for the local landing page:
import { ApolloDriver, ApolloDriverConfig } from…

Alex Serafini
- 25
- 4
0
votes
1 answer
How to pass the cors parameter to the new version (12.0.1) of @nestjs/graphql?
In my Nest.js project, I use the following versions of Node.js (both on the Frontend and Backend):
"node": "16.14.2",
"npm": "8.5.0"
I've updated from @nestjs/graphql (and all the packages) version ^9.1.2 to version ^12.0.1 and now I have an error…

Eugene Zalivadnyi
- 433
- 6
- 13
0
votes
0 answers
How to authenticate graphql subscription into nestjs?
I need to apply authentication in graphql subscription. I find the documentation and from the documentation -
@Module({
imports: [
ConfigModule.forRoot({ isGlobal: true }),
ScheduleModule.forRoot(),
…

Raihan Chowdhory
- 11
- 1
0
votes
0 answers
elastic apm not showing graphql's lex/ parse/ validate time
Currently, we are using the nestjs with Graphql,
we are able to show different spans in the execution phase,
For example: connecting redis/ db / external HTTP calls.
But is there a way to also show the time for graphql.lex, graphql.parse,…

AC28
- 282
- 2
- 11
0
votes
0 answers
Attaching DataLoaders to GraphQL context in NestJS
I have the following project setup where GraphQL module options are passed asynchronously using factory function and ConfigService. My objective is to attach DataLoaders to the GraphQL context while following this guide.
As stated in the ‘Attaching…

Koios Kvasir
- 143
- 2
- 6
0
votes
0 answers
NestJS GraphQL validations work after interceptors
In NestJs 9 with GraphQL main.ts I have such line:
app.useGlobalPipes(new ValidationPipe());
This run validations, but after interceptors, I want to run validation before interceptors.
I do not want to intercept validations because I have different…

Artu
- 31
- 1
- 5