@nestjs/graphql#ArgsType TypeScript Examples

The following examples show how to use @nestjs/graphql#ArgsType. 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: create-user.request.dto.ts    From domain-driven-hexagon with MIT License 6 votes vote down vote up
@ArgsType() // <- only if you are using GraphQL
@InputType() // <- only if you are using GraphQL
export class CreateUserRequest implements CreateUser {
  @ApiProperty({
    example: '[email protected]',
    description: 'User email address',
  })
  @MaxLength(320)
  @MinLength(5)
  @IsEmail()
  @Field() // <- only if you are using graphql
  readonly email: string;

  @ApiProperty({ example: 'France', description: 'Country of residence' })
  @MaxLength(50)
  @MinLength(4)
  @IsString()
  @Matches(/^[a-zA-Z ]*$/)
  @Field() // <- only if you are using graphql
  readonly country: string;

  @ApiProperty({ example: '28566', description: 'Postal code' })
  @MaxLength(10)
  @MinLength(4)
  @IsAlphanumeric()
  @Field() // <- only if you are using graphql
  readonly postalCode: string;

  @ApiProperty({ example: 'Grande Rue', description: 'Street' })
  @MaxLength(50)
  @MinLength(5)
  @Matches(/^[a-zA-Z ]*$/)
  @Field() // <- only if you are using graphql
  readonly street: string;
}
Example #2
Source File: find-many-args.template.ts    From amplication with Apache License 2.0 6 votes vote down vote up
@ArgsType()
export class ID {
  @ApiProperty({
    required: false,
    type: () => WHERE_INPUT,
  })
  @Field(() => WHERE_INPUT, { nullable: true })
  @Type(() => WHERE_INPUT)
  where?: WHERE_INPUT;

  @ApiProperty({
    required: false,
    type: [ORDER_BY_INPUT],
  })
  @Field(() => [ORDER_BY_INPUT], { nullable: true })
  @Type(() => ORDER_BY_INPUT)
  orderBy?: Array<ORDER_BY_INPUT>;

  @ApiProperty({
    required: false,
    type: Number,
  })
  @Field(() => Number, { nullable: true })
  @Type(() => Number)
  skip?: number;

  @ApiProperty({
    required: false,
    type: Number,
  })
  @Field(() => Number, { nullable: true })
  @Type(() => Number)
  take?: number;
}
Example #3
Source File: db.types.ts    From relate with GNU General Public License v3.0 6 votes vote down vote up
@ArgsType()
export class ListDbArgs {
    @Field(() => String)
    dbmsId: string;

    @Field(() => String)
    user: string;

    @Field(() => String)
    accessToken: string;
}
Example #4
Source File: connection-args.type.ts    From nestjs-relay with MIT License 6 votes vote down vote up
@ArgsType()
export class ConnectionArgs implements Relay.ConnectionArguments {
  @Field({
    nullable: true,
    description: 'Paginate before opaque cursor',
  })
  before?: Relay.ConnectionCursor;

  @Field({
    nullable: true,
    description: 'Paginate after opaque cursor',
  })
  after?: Relay.ConnectionCursor;

  @Field(returnsInt, { nullable: true, description: 'Paginate first' })
  first?: number;

  @Field(returnsInt, { nullable: true, description: 'Paginate last' })
  last?: number;
}
Example #5
Source File: article-aggregate.args.ts    From prisma-nestjs-graphql with MIT License 6 votes vote down vote up
@ArgsType()
export class ArticleAggregateArgs {
  @Field(() => ArticleWhereInput, { nullable: true })
  @Type(() => ArticleWhereInput)
  where?: ArticleWhereInput;

  @Field(() => [ArticleOrderByWithRelationAndSearchRelevanceInput], { nullable: true })
  orderBy?: Array<ArticleOrderByWithRelationAndSearchRelevanceInput>;

  @Field(() => ArticleWhereUniqueInput, { nullable: true })
  cursor?: ArticleWhereUniqueInput;

  @Field(() => Int, { nullable: true })
  take?: number;

  @Field(() => Int, { nullable: true })
  skip?: number;

  @Field(() => ArticleCountAggregateInput, { nullable: true })
  _count?: ArticleCountAggregateInput;

  @Field(() => ArticleAvgAggregateInput, { nullable: true })
  _avg?: ArticleAvgAggregateInput;

  @Field(() => ArticleSumAggregateInput, { nullable: true })
  _sum?: ArticleSumAggregateInput;

  @Field(() => ArticleMinAggregateInput, { nullable: true })
  _min?: ArticleMinAggregateInput;

  @Field(() => ArticleMaxAggregateInput, { nullable: true })
  _max?: ArticleMaxAggregateInput;
}
Example #6
Source File: full-name.args.ts    From nestjs-mercurius with MIT License 5 votes vote down vote up
@ArgsType()
export class FullNameArgs {
  @Field({ nullable: true })
  filter?: string;
}
Example #7
Source File: create-args.template.ts    From amplication with Apache License 2.0 5 votes vote down vote up
@ArgsType()
export class ID {
  @Field(() => CREATE_INPUT, { nullable: false })
  data!: CREATE_INPUT;
}