Commit 98c4e042 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'ps-use-to-s-on-variables-logger-tracer' into 'master'

Use to_s on variables in LoggerTracer

See merge request gitlab-org/gitlab!73671
parents 5a1579f5 779c4701
...@@ -45,14 +45,12 @@ module Gitlab ...@@ -45,14 +45,12 @@ module Gitlab
::Gitlab::GraphqlLogger.info(info) ::Gitlab::GraphqlLogger.info(info)
end end
def query_variables_for_logging(query)
clean_variables(query.provided_variables)
end
def clean_variables(variables) def clean_variables(variables)
ActiveSupport::ParameterFilter filtered = ActiveSupport::ParameterFilter
.new(::Rails.application.config.filter_parameters) .new(::Rails.application.config.filter_parameters)
.filter(variables) .filter(variables)
filtered&.to_s
end end
end end
end end
......
...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Graphql::Tracers::LoggerTracer do ...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::Graphql::Tracers::LoggerTracer do
query_fingerprint: query.fingerprint, query_fingerprint: query.fingerprint,
query_string: query_string, query_string: query_string,
trace_type: "execute_query", trace_type: "execute_query",
variables: variables variables: variables.to_s
}) })
dummy_schema.execute(query_string, variables: variables) dummy_schema.execute(query_string, variables: variables)
......
...@@ -32,7 +32,7 @@ RSpec.describe 'GraphQL' do ...@@ -32,7 +32,7 @@ RSpec.describe 'GraphQL' do
# operation_fingerprint starts with operation name # operation_fingerprint starts with operation name
operation_fingerprint: %r{^anonymous\/}, operation_fingerprint: %r{^anonymous\/},
is_mutation: false, is_mutation: false,
variables: variables, variables: variables.to_s,
query_string: query query_string: query
} }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment