Skip to content

Commit 636a154

Browse files
authored
Merge pull request #5433 from redterror/bug/tracing-no-selected-operation
Bug: sentry tracing - don't assume query.selected_operation is defined
2 parents 858f382 + 57449ad commit 636a154

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/graphql/tracing/sentry_trace.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def instrument(keyword, object)
4141
if query.selected_operation_name
4242
span.set_data('graphql.operation.name', query.selected_operation_name)
4343
end
44-
span.set_data('graphql.operation.type', query.selected_operation.operation_type)
44+
if query.selected_operation
45+
span.set_data('graphql.operation.type', query.selected_operation.operation_type)
46+
end
4547
end
4648
end
4749

0 commit comments

Comments
 (0)