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
{{ message }}
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
It is impossible to mutate to null or to query by null values in TypeScript.
Reproduction
// datamodel.graphqltypeRecord {
field: String
}
ctx.db.query.records({where: {field: null// Compile Error [ts] Type 'null' is not assignable to type 'string | undefined'.}});ctx.db.mutation.updateRecord({data: {field: null// Compile Error [ts] Type 'null' is not assignable to type 'string | undefined'.}})
Expected behavior?
Input types should use nullable values for optional fields.
The text was updated successfully, but these errors were encountered:
Yea, just run into this. Typescript bindings are incorrectly generated for non-required fields. I believe that issue is on this line where it doesn't include | null in case of nullable field.
In terms of GraphQL, nullable and optional is the same thing.
Are you talking about the TS types? If so, please bring this up in a new issue over at https://github.com/prismagraphql/prisma-binding 🙂
Commenting in closed issues is discouraged as it is easily lost in the sea of GitHub notifications. New issues are easier to keep in mind.
Ah, thanks for replying. I made a topic in the graphql-forum further describing my problem. I can also make an issue in the repo, but first I want to make sure I'm not doing something completely wrong
Bug Report
Current behavior
It is impossible to mutate to
null
or to query bynull
values in TypeScript.Reproduction
Expected behavior?
Input
types should use nullable values for optional fields.The text was updated successfully, but these errors were encountered: