apollo-feature-requests icon indicating copy to clipboard operation
apollo-feature-requests copied to clipboard

Support Client Controlled Nullability (CCN)

Open jpvajda opened this issue 3 years ago • 1 comments

Client-Controlled nullability gives more power to the consumer of a GraphQL API. It allows us to specify error boundaries in GraphQL by defining if a field shall be nullable or required in our GraphQL request. To give this power to the user, the RFC introduces new query syntax to let the user override type nullability on fields and specify where error boundaries are in the GraphQL request.

Three new operators can be used:

  • A "required designator" represented by ! which marks a field Non-Nullable
  • An "optional designator" represented by ? which marks a field Nullable
  • A "list operator" represented by [] which allows the above two operators to be applied to the elements of a list, or the list as a whole.

References

https://github.com/graphql/graphql-spec/issues/867

jpvajda avatar May 11 '22 19:05 jpvajda

Related:

https://github.com/apollographql/apollo-ios/releases/tag/1.0.0-alpha.4 https://github.com/apollographql/apollo-kotlin/issues/3549

jpvajda avatar May 18 '22 21:05 jpvajda

This will almost certainly be handled by the respective teams and as a larger initiative across Apollo whenever this RFC reaches stage 2 / stage 3.

trevor-scheer avatar May 10 '23 22:05 trevor-scheer