lib/graphql/tracing/appsignal_trace.rb in graphql-2.0.19 vs lib/graphql/tracing/appsignal_trace.rb in graphql-2.0.20
- old
+ new
@@ -3,11 +3,10 @@
module GraphQL
module Tracing
module AppsignalTrace
include PlatformTrace
-
# @param set_action_name [Boolean] If true, the GraphQL operation name will be used as the transaction name.
# This is not advised if you run more than one query per HTTP request, for example, with `graphql-client` or multiplexing.
# It can also be specified per-query with `context[:set_appsignal_action_name]`.
def initialize(set_action_name: false, **rest)
@set_action_name = set_action_name
@@ -44,10 +43,16 @@
RUBY
end
def platform_execute_field(platform_key)
Appsignal.instrument(platform_key) do
- super
+ yield
+ end
+ end
+
+ def platform_authorized(platform_key)
+ Appsignal.instrument(platform_key) do
+ yield
end
end
def platform_field_key(field)
"#{field.owner.graphql_name}.#{field.graphql_name}.graphql"