You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraphQL::Analysis::AST::FieldUsage has support for detecting deprecated arguments inside an input object however it only works for queries and not mutations. On that line with a mutation argument.definition.type.kind is a GraphQL::TypeKinds::TypeKind.
Versions
graphql version: 2.2.5
Steps to reproduce
This patched spec fails:
diff --git a/spec/graphql/analysis/ast/field_usage_spec.rb b/spec/graphql/analysis/ast/field_usage_spec.rb
index 9fc68e38d..e95a6a1b9 100644
--- a/spec/graphql/analysis/ast/field_usage_spec.rb+++ b/spec/graphql/analysis/ast/field_usage_spec.rb@@ -225,6 +225,18 @@ describe GraphQL::Analysis::AST::FieldUsage do
end
end
+ describe "mutation with deprecated argument" do+ let(:query_string) {%|+ mutation {+ pushValue(input: { oldSource: "deprecated" })+ }+ |}++ it "keeps track of nested deprecated arguments" do+ assert_equal ['Mutation.input.oldSource'], result[:used_deprecated_arguments]+ end+ end+
describe "when an argument prepare raises a GraphQL::ExecutionError" do
class ArgumentErrorFieldUsageSchema < GraphQL::Schema
class FieldUsage < GraphQL::Analysis::AST::FieldUsage
diff --git a/spec/support/dummy/schema.rb b/spec/support/dummy/schema.rb
index f159f4ffd..4435f578d 100644
--- a/spec/support/dummy/schema.rb+++ b/spec/support/dummy/schema.rb@@ -489,6 +489,7 @@ module Dummy
description "The root for mutations in this schema"
field :push_value, [Integer], null: false, description: "Push a value onto a global array :D" do
argument :value, Integer, as: :val
+ argument :input, DairyProductInput
end
def push_value(val:)
GLOBAL_VALUES << val
Expected behavior
GraphQL::Analysis::AST::FieldUsage can detect deprecated arguments within input objects in a mutation.
Actual behavior
GraphQL::Analysis::AST::FieldUsage can only detect deprecated arguments within input objects in a query, but not a mutation.
The text was updated successfully, but these errors were encountered:
Describe the bug
GraphQL::Analysis::AST::FieldUsage
has support for detecting deprecated arguments inside an input object however it only works for queries and not mutations. On that line with a mutationargument.definition.type.kind
is aGraphQL::TypeKinds::TypeKind
.Versions
graphql
version: 2.2.5Steps to reproduce
This patched spec fails:
Expected behavior
GraphQL::Analysis::AST::FieldUsage
can detect deprecated arguments within input objects in a mutation.Actual behavior
GraphQL::Analysis::AST::FieldUsage
can only detect deprecated arguments within input objects in a query, but not a mutation.The text was updated successfully, but these errors were encountered: