You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the GraphQL CLI, set an object property to a union containing null
import{User}from'@prisma/client';
@ObjectType()exportclassUserEntityimplementsUser{
@Field(()=>ID)id!: number;first_name!: string;middle_name!: string|null;// <-- Will not set the output object to be nullable. // Setting middle_name to undefined will throw a type error// because prisma will always return null for undefined fields}
Package version
12.0.11
Graphql version
graphql: 16.8.1
NestJS version
12.0.11
Node.js version
No response
In which operating systems have you tested?
macOS
Windows
Linux
Other
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current behavior
Using a union type with null. IE string | null
Minimum reproduction code
NA
Steps to reproduce
No response
Expected behavior
Using the GraphQL CLI, set an object property to a union containing null
Package version
12.0.11
Graphql version
graphql
: 16.8.1NestJS version
12.0.11
Node.js version
No response
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: