We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a query where the result has optional values
e.g.
data class SomeData( val requiredResult: String, val optionalResult: String? = null )
type { optionalResult: String requiredResult: String! }
Querying this gives me
{ "data": { "someQuery": { "requiredResult": "somedata" } }, "errors": [], "dataPresent": true }
Clientside, using apollo-client, I didn't get my data. I stumpled upon the same issue here:
apollographql/apollo-client#4267
which suggests that the graphql spec forbids just omitting values and instead we should return:
"someQuery": { "requiredResult": "somedata", "optionalResult": null, }
The text was updated successfully, but these errors were encountered:
Nvm this works correctly in graphql-kotlin.
Sorry, something went wrong.
The issue is my json serializer removing the null value.
An integration test for optional results (#151)
4d230fc
* An integration test for optional results. See #150 * Refactoring into current package structure. * Cleanup (this will be squashed :o)
An integration test for optional results (ExpediaGroup#151)
2d7d00f
* An integration test for optional results. See ExpediaGroup#150 * Refactoring into current package structure. * Cleanup (this will be squashed :o)
No branches or pull requests
I have a query where the result has optional values
e.g.
Querying this gives me
Clientside, using apollo-client, I didn't get my data. I stumpled upon the same issue here:
apollographql/apollo-client#4267
which suggests that the graphql spec forbids just omitting values and instead we should return:
The text was updated successfully, but these errors were encountered: