Skip to content

Commit

Permalink
schema: Deprecated directive is also valid on :argument-definition
Browse files Browse the repository at this point in the history
In the current Working Draft of the GraphQL specification, @deprecated
directives are now also valid for ARGUMENT_DEFINITION clauses.
  • Loading branch information
sundbry committed Apr 20, 2023
1 parent afa9c04 commit 295d3c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/com/walmartlabs/lacinia/schema.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@
(map-kvs compile-directive-args
(assoc directive-defs
:deprecated {:args {:reason {:type 'String}}
:locations #{:enum-value :field-definition :input-field-definition}})))))
:locations #{:argument-definition :enum-value :field-definition :input-field-definition}})))))

(defn ^:private validate-directives-by-category
[schema category]
Expand Down
6 changes: 4 additions & 2 deletions test/com/walmartlabs/lacinia/directives_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@
(deftest union-directive-inapplicable
(directive-test
"Directive @deprecated on union `Ebb' is not applicable."
{:allowed-locations #{:enum-value
{:allowed-locations #{:argument-definition
:enum-value
:field-definition
:input-field-definition}
:directive-type :deprecated
Expand All @@ -375,7 +376,8 @@
(deftest scalar-directive-inapplicable
(directive-test
"Directive @deprecated on scalar `Ebb' is not applicable."
{:allowed-locations #{:enum-value
{:allowed-locations #{:argument-definition
:enum-value
:field-definition
:input-field-definition}
:directive-type :deprecated
Expand Down

0 comments on commit 295d3c4

Please sign in to comment.