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 expecting to receive teams like
teams: [[1, 2], null, [3, 4], null]
But getting the error
Cannot return null for non-nullable field Round.teams.