Tag: nestjs
-
Should I use REST or GraphQL for the login?
0 I have a GraphQL API, but I have doubts about whether to login in a graphql mutation or do it in a REST endpoint, I know that it can be done in both ways. Any comments? I have read and even in some courses I heard that for the login the ideal is to…
-
How to create nested domain in nestjs graphql?
0 How to create subdomains in nestjs/graphql? to be able to query something like query { Foo { Bar { search(page: 1) { id name } } } } Basically how can I create the Foo and Bar handlers? graphql nestjs Share Follow asked 1 hour ago JonathanJonathan 4,72477 gold badges4545 silver badges6565 bronze badges…
-
nestjs module is not injected properly
0 I created new module in nest using the command nest g module UserModule src/user-module/user.resolver.ts is – import { Query, Resolver } from ‘@nestjs/graphql’; import { UserService } from ‘./user.service’; export class UserResolver { constructor (private readonly user: UserService) { this.user = user; } @Query(‘users’) async users() { return this.user.getUsers(); } } then src/user-module/user-module.module.ts is…
-
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 avoid circular dependencies in resolvers
2 Let’s say i have two entities: // user.entity.ts @ObjectType() @Entity() export class User { @Field() @PrimaryGeneratedColumn(‘uuid’) id: string; @Field() @Column({ unique: true }) username: string; @Column({ select: false }) password: string; @Field(() => [Task]) @OneToMany(() => Task, (task) => task.author) authorOfTasks: Task[] } and // task.entity.ts @ObjectType() @Entity() export class Task { @Field() @PrimaryGeneratedColumn(‘uuid’)…
-
mergeTypeDefs(allTypeDefs) does not recognize apollo federation directives @key @external
0 I have this combined typeDefs (allTypeDefs) file: ["@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key","@external"]) scalar Date type Name { first_name: String! middle_name: String last_name: String } type Safe @key(fields: "safe_id"){ safe_id: ID! owner: User! # HAS_SAFE wallets: [Wallet!]! } type User @key(fields: "user_id") { user_id: ID! email: String! role: String! permissions: [String!]! created_at: Date! updated_at: Date! username:…
-
Trying to build custom filter using apollo errors released with latest version 4, using nestjs
-1 I am trying to build an custom exception filter for graphql host using nestjs and apollo errors with all the standard codes, but not able to see any documentation for graphql host. graphql nestjs apollo-server Share Improve this question Follow edited 1 hour ago Krish909 asked 2 hours ago Krish909Krish909 7722 silver badges1212 bronze…
-
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…
-
Nest Js Graphql Resolve Field with Circular Dependency
0 I have a problem with a circular dependency in a GraphQL model. I’m using Nestjs Graphql MongoDb Mongoose ad I have 3 entities. @ObjectType() @Schema({ timestamps: true }) export class User { @Field(() => ID) _id: string; @Field({ nullable: true }) @Prop({ nullable: true, unique: true }) pseudoDiscord?: string; } @ObjectType() @Schema({ timestamps: true…