@nestjs/graphql#Directive TypeScript Examples
The following examples show how to use
@nestjs/graphql#Directive.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: post.ts From nestjs-mercurius with MIT License | 6 votes |
@Directive('@key(fields: "id")')
@ObjectType()
export class Post {
@Field(() => ID)
id: number;
@Field()
title: string;
@Field()
authorId: number;
@Field({ nullable: true })
public?: boolean;
@Field(() => Date)
publishedAt: Date;
}
Example #2
Source File: user.ts From nestjs-mercurius with MIT License | 6 votes |
@Directive('@key(fields: "id")')
@ObjectType()
export class User {
@Field(() => ID)
id: number;
@Field()
name: string;
@Field({ defaultValue: true })
isActive?: boolean;
}
Example #3
Source File: cat.ts From nestjs-mercurius with MIT License | 5 votes |
@Directive('@uppercase')
@Field()
name: string;
Example #4
Source File: person.interface.ts From nestjs-mercurius with MIT License | 5 votes |
@Directive('@uppercase')
@Field(() => String, { nullable: true })
name?: string;
Example #5
Source File: user.ts From nestjs-mercurius with MIT License | 5 votes |
@Directive('@external')
@Field(() => ID)
id: string;
Example #6
Source File: user.ts From nestjs-mercurius with MIT License | 5 votes |
@Directive('@extends')
@Directive('@key(fields: "id")')
@ObjectType()
export class User {
@Directive('@external')
@Field(() => ID)
id: string;
}