-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[WIP] Experimental support for semantic-non-null #4192
base: 16.x.x
Are you sure you want to change the base?
Conversation
@github-actions publish-pr-on-npm |
Boarding was just called... So that's it for now! |
@JoviDeCroock If you have a moment, looks like https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ is causing us issues. I tried updating them but CI is still failing, I think maybe my fixes to |
This comment has been minimized.
This comment has been minimized.
@benjie The latest changes of this PR are available on NPM as Also you can depend on latest version built from this PR: |
01ae6dc
to
eb9b6c8
Compare
This PR overhauls the project so that it can support more versions of GraphQL. It tests it using GraphQL v15, v16 and v17 plus the semantic-non-null supporting branch `graphql@canary-pr-4192` (from graphql/graphql-js#4192). It also changes the logic around applying `@semanticNonNull` to an already non-null field (in this case, the non-null wins and the semantic is ignored). Further it exports a new method, `convertFieldConfig`, which can be used to convert a lone GraphQLFieldConfig object to nullable or strict mode based on its embedded `@semanticNonNull` directive (via astNode).
DISCLAIMER: I'm very jetlagged right now, and it's late. This is almost certainly full of issues.
The main aim of this PR is so we can start experimenting with both semantic non-null and disabling error bubbling.
Semantic non-null has been added using the asterisk (
Int*
) syntax, because that was easiest (and I'm doing this from an airport lounge whilst I wait for boarding...). I know this isn't what we've most recently discussed, but it's a smaller lift and means we can start experimenting.To disable error bubbling, pass
errorPropagation: false
as part of the execution args:graphql({ schema, source, errorPropagation: false })
.To see the full types, pass
nullability: 'FULL'
togetIntrospectionQuery
, e.g.getIntrospectionQuery({ nullability: 'FULL' })
. (I don't like this current enum, but it'll do for now.)Note: this implementation does NOT align with my previous thoughts exactly, and it is definitely not final.
TODO:
!!
or whatever