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
This is a problem, because when we create a new field in our local database, there is no compiler warning at all if we forget to add that field on the graphql.
So, a solution for this would be a build option that make the required keyword to be generated on these Input$ types, if we configure it with that option.
So, in build.yaml
targets:
$default:
builders:
graphql_codegen:
options:
input_type_primitives_gen_required: bool # only primitives, not nested inputs
...
That would make the compiler useful to alert us when something has changed on the query and we forget to specify those new fields in the mutations/queries.
The text was updated successfully, but these errors were encountered:
👋 @JCKodel
Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible.
Please make sure you have provided enough context.
This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.
I have this piece of graphql schema (from Hasura):
Hasura should made those fields required, since they are indeed required (they are all
NOT NULL
in the database).Then, I need to insert that entity:
When
Variables$Mutation$PushUserData
is created, theInput$UserLogins_insert_input
is created with all fields as not required:This is a problem, because when we create a new field in our local database, there is no compiler warning at all if we forget to add that field on the graphql.
So, a solution for this would be a build option that make the
required
keyword to be generated on theseInput$
types, if we configure it with that option.So, in
build.yaml
Would generate that class as:
That would make the compiler useful to alert us when something has changed on the query and we forget to specify those new fields in the mutations/queries.
The text was updated successfully, but these errors were encountered: