-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
directive to apply omitempty on nested fields #165
Comments
Also, when the directive is applied to the entire query, I get this error:
I was expecting the directive to apply omitempty everywhere in the query, including deeply nested fields of the input variable, regardless of whether they are optional or not. |
By the way, this functionality is important when using Dgraph for the use case described here: https://discuss.dgraph.io/t/best-way-to-avoid-duplicate-xid-found/10369 Dgraph expects a block of a mutation's input to include only the XID field and have no other fields set in order for the block to be used as a reference to another block. |
After investigating further, I found that the best way to use genqlient with Dgraph is to have Is there a global configuration option to enable these two changes to the generated code? |
I think BTW, the directive is not written quite right, see #151. |
This appears to be unsupported as of v0.5.0. Hasura generates structs with lots of fields ( Trying to access a nested field results in this error: |
I'm getting this error when using the @genqlient directive on the following mutation and schema:
Error:
client.graphql:339: for is only applicable to operations and arguments
Mutation:
Schema:
Is the directive above written the correct way? I tried following the explanation at: https://github.com/Khan/genqlient/blob/main/docs/FAQ.md#-nullable-fields
Also, is possible to add a directive on a nested subfield? So for example, something like:
# @genqlient(for: "AddAuthorInput.posts.title", omitempty: true)
Is it possible to add a directive on a field of struct type that's nested in the top level type? So for example, something like:
# @genqlient(for: "PostRef.title", omitempty: true)
The text was updated successfully, but these errors were encountered: