Skip to content

Commit

Permalink
Support EnumValues when printing directives. (#21)
Browse files Browse the repository at this point in the history
* Added EnumValue use case for Directive Argument

* update the version to 1.1.2 to support enumValue when printing directives.
  • Loading branch information
hsehweil authored May 19, 2020
1 parent ad4e1b5 commit d7f771e
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 155 deletions.
2 changes: 1 addition & 1 deletion fixtures/directiveSchemas/baseTypes.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type NestedFoo {
}

enum Bar {
MORE @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"])
MORE @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES)
VALUES
EVERYONE
}
Expand Down
2 changes: 1 addition & 1 deletion fixtures/directiveSchemas/directives.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""This directive demonstrates using multiple args with multiple types."""
directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!) on ENUM_VALUE | FIELD_DEFINITION | OBJECT
directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!, enumArg: Bar) on ENUM_VALUE | FIELD_DEFINITION | OBJECT

# This directive demonstrates using no args. And using comment syntax instead
directive @noArg on ENUM_VALUE | FIELD_DEFINITION | OBJECT
Expand Down
2 changes: 1 addition & 1 deletion fixtures/directiveSchemas/extendedTypes.graphql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extend type NestedFoo {
anotherAttribute: String! @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"]) @noArg
anotherAttribute: String! @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES) @noArg
oldAttribute: String! @deprecated(reason: "reason")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""This directive demonstrates using multiple args with multiple types."""
directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!) on ENUM_VALUE | FIELD_DEFINITION | OBJECT
directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!, enumArg: Bar) on ENUM_VALUE | FIELD_DEFINITION | OBJECT

"""
This directive demonstrates using no args. And using comment syntax instead
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""This directive demonstrates using multiple args with multiple types."""
directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!) on ENUM_VALUE | FIELD_DEFINITION | OBJECT
directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!, enumArg: Bar) on ENUM_VALUE | FIELD_DEFINITION | OBJECT

"""
This directive demonstrates using no args. And using comment syntax instead
Expand All @@ -10,7 +10,7 @@ directive @noArg on ENUM_VALUE | FIELD_DEFINITION | OBJECT
directive @nullArg(stringArg: String) on ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | OBJECT

enum Bar {
MORE @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"])
MORE @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES)
VALUES
EVERYONE
}
Expand All @@ -28,6 +28,6 @@ input Input {
type NestedFoo {
id: ID!
bar: Bar!
anotherAttribute: String! @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"]) @noArg
anotherAttribute: String! @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES) @noArg
oldAttribute: String! @deprecated(reason: "reason")
}
Loading

0 comments on commit d7f771e

Please sign in to comment.