-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Fix @_required directive when the schema is available #3685
Conversation
If graphcache was configured with the full schema, the `@_required` directive would be ignored on nullable fields. This diff tweaks the condition to fix that behaviour.
🦋 Changeset detectedLatest commit: a910c50 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind adding a test and changeset?
Should be able to, will actually need to check out the code first 😅 Can I just get confirmation that this is actually fixing unintended behaviour? The docs are a little confusing on this point, even though required seems most useful when there's a schema saying a field is optional:
|
Okay, should be good to go 🤞🏻 |
I'd say it's unintended behaviour, yes. It's definitely not something we had in mind, since the directives were mostly tested as an alternative to schema awareness. |
If graphcache was configured with the full schema, the
@_required
directive would be ignored on nullable fields. This diff tweaks the condition to fix that behaviour.