Returning null Values in GraphQL Responses #1717
giordano-newday
started this conversation in
General
Replies: 1 comment 2 replies
-
|
We are currently running into the same problem. Apollo (React client in our case) expects nullable fields that resolve to |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm part of a team using DGS for our backend, Apollo Client on Android and a custom GraphQL client on iOS. We've encountered an issue: DGS omits fields in the response when they are nullable and have a null value. This hasn't been a problem for our current setup, but we're exploring using Apollo Client for iOS, which expects these fields to be present and returns a decode error when they're absent.
From our understanding of the GraphQL spec, nullable fields should be included in responses as null. Is there a configuration in DGS that allows for this behaviour?
A link to the Apollo Client Swift question: apollographql/apollo-ios#3216
Beta Was this translation helpful? Give feedback.
All reactions