Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 2 additions & 8 deletions lib/skylight/normalizers/graphql/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,11 @@ class Execute < Base
# to be used for graphql >= 2.5
#
def normalize(trace, name, payload)
if payload[:query]
_execute_query_normalize(trace, name, payload)
else
[CAT, "graphql.#{key}", nil]
end
payload[:query] ? _execute_query_normalize(trace, name, payload) : [CAT, "graphql.#{key}", nil]
end

def normalize_after(trace, span, name, payload)
if payload[:multiplex]
_execute_multiplex_normalize_after(trace, span, name, payload)
end
_execute_multiplex_normalize_after(trace, span, name, payload) if payload[:multiplex]
end

private
Expand Down
4 changes: 2 additions & 2 deletions lib/skylight/probes/graphql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def execute_query_lazy(**metadata, &blk)
end

# GraphQL versions >= 2.5 are missing this notification
module AnalyzeQueryNotification
module AnalyzeQueryNotification
def analyze_query(**metadata, &blk)
if @notifications_engine
@notifications_engine.instrument("analyze_query.graphql", metadata, &blk)
Expand All @@ -76,7 +76,7 @@ def analyze_query(**metadata, &blk)
end
end
end

module ClassMethods
def new_trace(*, **)
unless @__sk_instrumentation_installed
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/graphql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

if enable
def graphql_2_5?
GraphQL::VERSION >= Gem::Version.new("2.5.0")
Gem::Version.new("2.5.0") <= GraphQL::VERSION
end

def multiplex_event
Expand Down
Loading