-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Root query: generate {x}Option
method for fields with an optional interface type
#1223
Root query: generate {x}Option
method for fields with an optional interface type
#1223
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Shouldn't the same thing be applied to mutations and subscriptions?
Good point. I guess mutations and subscriptions should be updated as well. I will push an update soon. |
…th an optional interface type
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…nterface type (ghostdogpr#1223) * Root query: generate `{x}Option` method for fields with an optional interface type * Root mutation/subscription: generate `{x}Option` method for fields with an optional interface type * Fix root mutation
…nterface type (ghostdogpr#1223) * Root query: generate `{x}Option` method for fields with an optional interface type * Root mutation/subscription: generate `{x}Option` method for fields with an optional interface type * Fix root mutation
ClientWriter
does not handle optional interfaces properly of the root query.I fixed the processing of the root query in the scope of the PR. If the output type of a field is an interface, the
ClientWriter
will generate two methods:def {x}(...)
anddef {x}Option(...)
.Schema 1 (without root schema)
ClientWriter
generates two methods:node(id: ID)(...)
andnodeOption(id: ID)(...)
.Schema 2 (with top-level
schema
definition)ClientWriter
generates only one method:node(id: ID)(...)
.