Skip to content

Ability to add directives on extended enum values #952

@BoD

Description

@BoD

This is currently disallowed by the specification:

enum Foo {
  bar
  baz
}

extend enum Foo {
  baz @myDirective
}

From https://spec.graphql.org/draft/#sec-Enum-Extensions.Type-Validation:

  1. All values of an Enum type extension must not already be a value of the original Enum.

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions