-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ability to add directives on extended enum values #952
Comments
Interesting! You're not attempting to add the enum, but instead to add the directive to it, and there's no way to tell the system that's your intent. I recommend that you add a 10 minute topic to an upcoming GraphQL Working Group to discuss it, e.g.: https://github.com/graphql/graphql-wg/blob/main/agendas/2022/2022-07-07.md Let me know if you need any guidance, or if you cannot attend WG and would like me to represent it on your behalf. |
This hits on a potentially deeper topic, which is that you sometimes want to merge schema definitions and schema extensions only give us a subset of that merging property (for instance, you can't add an argument to an existing field via schema extensions). The tricky bit is that sometimes you want to merge via a union operation and sometimes via an intersect. Extend implies union, and perhaps we want to just allow deep-unioning for all extensions. |
(From the working group we also noted that it's not possible to add directives to fields in this manner for similar reasons, and a solution to one of these should solve both.) |
This is currently disallowed by the specification:
From https://spec.graphql.org/draft/#sec-Enum-Extensions.Type-Validation:
Our immediate use-case is that we generate code on the client side and would like to allow renaming certain enum values (in case their name is a reserved keyword, or clashes with other fields in the generated code).
Has this ever come up and would it make sense to allow it?
The text was updated successfully, but these errors were encountered: