Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Implement support for @_optional and @_required on fields #32

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

kitten
Copy link
Member

@kitten kitten commented Jan 22, 2024

Resolves #30

Summary

This supports client-controlled nullability directives, as implemented for instance in in Graphcache for an example.

When applied,

  • @_optional / @optional turns a non-nullable field into a nullable one.
  • @_required / @required turns a nullable field into a non-nullable one.

Set of changes

  • Add getTypeDirective as unwrapType input and override type as required

Copy link

changeset-bot bot commented Jan 22, 2024

🦋 Changeset detected

Latest commit: af853c3

The changes in this PR will be included in the next version bump.

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

@kitten kitten merged commit d29ed37 into main Jan 22, 2024
4 checks passed
@kitten kitten deleted the feat/support-optional-required branch January 22, 2024 13:39
@github-actions github-actions bot mentioned this pull request Jan 22, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: allow reacting to client-side directives
2 participants