From d62022980f08762cd55afb8189025e723b9dd5ed Mon Sep 17 00:00:00 2001 From: Yury Lebedev Date: Thu, 5 Sep 2024 14:40:43 +0200 Subject: [PATCH] Simplify graphql argument value fetching --- lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb b/lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb index 15dc7579ed8..77375f9a5b3 100644 --- a/lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb +++ b/lib/datadog/appsec/contrib/graphql/gateway/multiplex.rb @@ -90,8 +90,7 @@ def argument_value(argument, query_variables) when ::GraphQL::Language::Nodes::VariableIdentifier # we need to pass query.variables here instead of query.provided_variables, # since #provided_variables don't know anything about variable default value - var_name = argument.value.name - query_variables.fetch(var_name) if query_variables.key?(var_name) + query_variables[argument.value.name] when ::GraphQL::Language::Nodes::InputObject arguments_hash(argument.value.arguments, query_variables) else