apollo-feature-requests
apollo-feature-requests copied to clipboard
Support Client Controlled Nullability (CCN)
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
Related:
https://github.com/apollographql/apollo-ios/releases/tag/1.0.0-alpha.4 https://github.com/apollographql/apollo-kotlin/issues/3549
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.