-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: support generating correct types for @oneOf
input types
#7886
Conversation
🦋 Changeset detectedLatest commit: b4cf959 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The latest changes of this PR are available as alpha in npm (based on the declared
|
packages/plugins/typescript/typescript/tests/typescript.spec.ts
Outdated
Show resolved
Hide resolved
oneOf requires that all fields are nullable in the schema, and promises/requires that exactly one will be non-null at run time. You have tests for non-null fields on a oneOf; that’s expressly forbidden in the spec. |
packages/plugins/other/visitor-plugin-common/src/base-types-visitor.ts
Outdated
Show resolved
Hide resolved
@n1ru4l @dotansimha Can this change be published in a prerelease? |
@purkhusid You can use the versions here; |
@ardatan Ah, thought some commits were missing from that release but it seems like everything is there. Thanks! |
Sadly this is breaking for me and blocking me from upgrading in general, see #7938 |
Support for the
@oneOf
directive on input object types.Things to consider:
Should we make this available behind a flag?
@onOf
is still in the RFC stage and the behavior could change slightly. Should we, therefore, make this opt-in?References:
@oneOf
directive graphql/graphql-js#3513 (comment)