cjmling / findings

Notes on stuff i finds worth keeping for quick reference later on.
2 stars 0 forks source link

Apollo graphql field nullable #322

Open cjmling opened 2 years ago

cjmling commented 2 years ago

use {nullable: true}

@ObjectType()
@InputType('FilterInput')
export class Filter {
  @Field(() => String, { nullable: true })
  avgFilter: String;
}

Apollo graphql field nullable optional

cjmling commented 2 years ago

Or make the field no type specific and nullable

@Field({ nullable: true })