Skip to content
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

@oneOf directive support #1542

Open
mengledowl opened this issue Oct 10, 2023 · 3 comments
Open

@oneOf directive support #1542

mengledowl opened this issue Oct 10, 2023 · 3 comments
Labels
Need More Info 🤷‍♂️ Further information is requested Question ❔ Not future request, proposal or bug issue

Comments

@mengledowl
Copy link

The GraphQL working group recently upgraded the @oneOf directive RFC (graphql/graphql-spec#825) to RFC 2, which states:

GraphQL libraries should implement drafts to provide valuable feedback, though are encouraged not to enable the draft feature without explicit opt-in when possible.

This is one of the most anticipated (IMO) new additions to the spec, and the work has already been done for graphql-js (though unreleased as of yet).

I would like to propose that this feature be exposed in TypeGraphQL for those of us who want to have early access to it. I'm not sure what would be involved in that effort (if any), but wanted to get the conversation started.

@MichalLytek
Copy link
Owner

@Directive("@oneof")? 🤔

@MichalLytek MichalLytek added Question ❔ Not future request, proposal or bug issue Need More Info 🤷‍♂️ Further information is requested labels Oct 15, 2023
@pmooney-socraticworks
Copy link

@MichalLytek Can you expand on your response or provide an example please? I'm running into this same issue, and the path forward on@oneOf is unclear to me.

@MichalLytek
Copy link
Owner

@Directive("@oneof") is used to put schema directive on your input field, as the new graphql spec says.

Then you need a graphql runtime that supports this directive (new graphql-js does it) so it will apply runtime logic to your input type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need More Info 🤷‍♂️ Further information is requested Question ❔ Not future request, proposal or bug issue
Projects
None yet
Development

No branches or pull requests

4 participants
@mengledowl @MichalLytek @pmooney-socraticworks and others