File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
spec/graphql/analysis/ast Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ def extract_deprecated_arguments(argument_values)
4343
4444 if argument . definition . type . kind . input_object?
4545 extract_deprecated_arguments ( argument . value . arguments . argument_values ) # rubocop:disable Development/ContextIsPassedCop -- runtime args instance
46+ elsif argument . definition . type . kind . enum?
47+ enum_value = argument . definition . type . values [ argument . value ]
48+ @used_deprecated_arguments << argument . definition . path if enum_value . deprecation_reason
4649 elsif argument . definition . type . list?
4750 argument
4851 . value
Original file line number Diff line number Diff line change 138138 end
139139 end
140140
141+ describe "query with deprecated enum argument" do
142+ let ( :query_string ) { %|
143+ query {
144+ fromSource(source: YAK) {
145+ id
146+ }
147+ }
148+ | }
149+
150+ it "keeps track of deprecated arguments" do
151+ assert_equal [ 'Query.fromSource.source' ] , result [ :used_deprecated_arguments ]
152+ end
153+ end
154+
141155 describe "query with an array argument sent as null" do
142156 let ( :query_string ) { %|
143157 query {
You can’t perform that action at this time.
0 commit comments