-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2021-05-13] Query Level Nullability - open PR #694
Comments
@twof is this complete? I recall seeing some issues created. |
@benjie hey thanks for checking in! We've been working on the implementation first, and then we'll be turning it into a fully fledged RFC. People can track progress on the implementation in this GraphQL.js fork And comment on the strawman issue for now until we have something comprehensive up. |
GraphQL.js PR is up for review and we're looking for feedback: graphql/graphql-js#3281 |
The ["Nullability RFC" for GraphQL](graphql/graphql-wg#694) allows fields to individually be marked as optional or required in a query by the client-side. ([See Strawman Proposal](graphql/graphql-spec#867)) If a field is marked as optional then it's allowed to be missing and `null`, which can control where missing values cascade to: ```graphql query { me { name? } } ``` If a field is marked as required it may never be allowed to become `null` and must cascade if it otherwise would have been set to `null`: ```graphql query { me { name! } } ```
The ["Nullability RFC" for GraphQL](graphql/graphql-wg#694) allows fields to individually be marked as optional or required in a query by the client-side. ([See Strawman Proposal](graphql/graphql-spec#867)) If a field is marked as optional then it's allowed to be missing and `null`, which can control where missing values cascade to: ```graphql query { me { name? } } ``` If a field is marked as required it may never be allowed to become `null` and must cascade if it otherwise would have been set to `null`: ```graphql query { me { name! } } ``` In Graphcache, we imagine that the nullable field — which would be marked with `required: 'optional'` — can allow Graphcache to make more data nullable and hence partial, which enhances schema awareness, even if it's not actively used. The required fields — which would be marked with `required: 'required'` — would force Graphcache to include this data, regardless of what schema awareness may say, which also enhances partial data in the presence of schema awareness, since it increases what the cache may deliver. In other words, it guarantees a "forced outcome" in both cases, without having to look up whether a field is nullable in the schema. In the future, we may even derive the `RequiredStatus` of a `FieldNode` in an external place and never call `isFieldNullable` with a schema in the query traversal.
Here are a couple docs we've been working on that might be helpful for people reviewing the RFC: |
All CI checks are passing on our GraphQL.js branch |
Spec changes will be happening in this branch: graphql/graphql-spec#895 The PR is not yet ready for review, but I'll update here when it is. |
The spec PR is ready for review! |
Note: Action Item issues are reviewed and closed during Working Group
meetings.
The text was updated successfully, but these errors were encountered: