Does GraphQL have the possibility for the client to tell the server that it wants a field only if that field is not null
?
Given the query
You can use this ES6 syntax in front-end:
Object.keys(data).forEach((key) => (data[key] == null) && delete data[key]);
As far as I know this is not possible, there are directives like @skip and @include. Directives but they need a variable, I think you can make your case with the graphql team to extend the directives to only include the field if it's not null.