Tag: nestjs-graphql
-
How to have an offset paginated query and a cursor paginated query with Nestjs-query?
1 I’m using nestjs-query, and I have an entity (TodoItem). I would like to generate 2 resolvers/queries to fetch many todos: A cursor paginated one An offset paginated one. This is what I did: resolvers: [ { DTOClass: TodoItemDTO, EntityClass: TodoItemEntity, create: { disabled: true }, update: { disabled: true }, delete: { disabled: true…
-
I am getting an error when using nestjs-tenancy with mongoose and graphql
0 With basic setup as outlined in the docs https://github.com/needle-innovision/nestjs-tenancy module doesn’t work with nestjs and graphql. After little debugging I found that "getTenantFromRequest" in the TenancyCore module called twice. In first call req was available and I was able to capture the header. But in the second call req was null. Which case tenantId…
-
Importing “@authenticated” directive using nestjs, apollo, and code-first approach
0 I am using NestJS server with microservices and Apollo Router. I want to add "@authenticated" directive to my resolvers so I can omit authentication on requests to routes that do not require it. When using @Directive("@authenticated"), I get an error saying that I either have to use "@federation__authenticated" (which throws error saying it doesn’t…
-
Pass GraphQL Header from request to subsequent Axios Request
0 I have an Angular application which is using Apollo Client for querying a GraphQL Server from a NestJS application. This NestJS application is executing a request through Axios to an external Backend. How could be passed the client header set in all the GraphQL requests to the backend request through Axios? Apollo Client GraphQL…
-
How to use middleware with Nest.js and GraphQL | Nest.js GraphQL Middleware?
0 I’m working on a Nest.js project that utilizes GraphQL for its API, and I’m interested in implementing middleware to handle specific tasks in my GraphQL resolvers. However, I’m having some trouble figuring out how to integrate middleware effectively within the Nest.js and GraphQL ecosystem. Here’s a brief overview of my project’s current setup: I’m…
-
nestjs/graphql: How to return mixed array of values and nulls?
0 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 I declare the teams field to return mixed values of string and null? Do I need to write own scalar for it? I’m…
-
Getting error of Cannot read properties of undefined (reading ‘service’) when using i18n translation in nestjs with graphql
-1 i am using nest-i18n package to use localization in my project but when translating the message i get the error Cannot read properties of undefined (reading ‘service’) Here is my code please help me to find out the exact error Note:- I have tried to add I18nValidationPipe as a provider in app module as…