Skip to content

fix: support GraphQL::Query::Partial in graphql instrumentation #1591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@ def analyze_query(query:, &block)
def execute_query(query:, &block)
attributes = {}
attributes['graphql.operation.name'] = query.selected_operation_name if query.selected_operation_name
attributes['graphql.operation.type'] = query.selected_operation.operation_type
attributes['graphql.document'] = query.query_string
if defined?(::GraphQL::Query::Partial) && query.is_a?(::GraphQL::Query::Partial)
attributes['graphql.partial.path'] = query.path.to_s
else
attributes['graphql.operation.type'] = query.selected_operation.operation_type
attributes['graphql.document'] = query.query_string
end

tracer.in_span('graphql.execute_query', attributes: attributes) do
super
Expand Down