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
Describe the bug
Currently if a property within the gql schema is set as non nullable, but has a default value assigned to it, the generated typescript property will be set as required.
Expected behavior
If there is a provided default value, the generated ts type should allow for a value of undefined, as this is when the default value would be applied.
Environment:
running on the code sandbox
Additional context
The issue arose when I was trying to integrate with a gql schema that indicated an array type with a default value. I wanted the default value, but due to this issue, I had to explicitly enter that value, as opposed to just omitting the type and letting the default handle it.
The text was updated successfully, but these errors were encountered:
Hmmm, this has caused a bunch of incompatible changes in our codebase from a patch release.
Making these optional might make sense on a client, but not on a server – because they're guaranteed to have values. What's the best way to get around this issue?
Describe the bug
Currently if a property within the gql schema is set as non nullable, but has a default value assigned to it, the generated typescript property will be set as required.
To Reproduce
Steps to reproduce the behavior:
App
has a default forusers
, it is still required in the generated ts typecodegen.yml
config file:Expected behavior
If there is a provided default value, the generated ts type should allow for a value of
undefined
, as this is when the default value would be applied.Environment:
Additional context
The issue arose when I was trying to integrate with a gql schema that indicated an array type with a default value. I wanted the default value, but due to this issue, I had to explicitly enter that value, as opposed to just omitting the type and letting the default handle it.
The text was updated successfully, but these errors were encountered: