Does GraphQL have the ability for the client to tell the server that it wants a field only if this field is not null ?
Given the request
query HeroAndFriends { hero { name friends { name } } }
The answer should look like this:
{ "data": { "hero": { "friends": [ { "name": "Luke Skywalker" }, { "name": "Han Solo" }, { "name": "Leia Organa" } ] } } }
instead
{ "data": { "hero": { "name": null, "friends": [ { "name": "Luke Skywalker" }, { "name": "Han Solo" }, { "name": "Leia Organa" } ] } } }
Is this possible without breaking GraphQL specifications?
graphql
Fweigl
source share