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

Improve counter-examples for "Enum Type Default Value Uses Inaccessible Value" #69

Open
glen-84 opened this issue Dec 16, 2024 · 0 comments

Comments

@glen-84
Copy link
Contributor

glen-84 commented Dec 16, 2024

The following example violates this rule because the default value for the field
field in type Input1 references an enum value (FOO) that is marked as
@inaccessible.

type Query {
  field(arg: Enum1 = FOO): [Baz!]!
}

input Input1 {
  field: Enum1 = FOO
}

directive @directive1(arg: Enum1 = FOO) on FIELD_DEFINITION

enum Enum1 {
  FOO @inaccessible
  BAR
}
type Query {
  field(arg: Input1 = { field2: "ERROR" }): [Baz!]!
}

directive @directive1(arg: Input1 = { field2: "ERROR" }) on FIELD_DEFINITION

input Input1 {
  field1: String
  field2: String @inaccessible
}
  1. The first counter-example references the usage of FOO on Input1.field, but then there are two other usages of FOO that don't seem necessary.
  2. The second counter-example has no enum types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant