File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ def platform_authorized(platform_key)
5555 end
5656 end
5757
58+ def platform_resolve_type(platform_key)
59+ Appsignal.instrument(platform_key) do
60+ yield
61+ end
62+ end
63+
5864 def platform_field_key(field)
5965 "#{ field . owner . graphql_name } .#{ field . graphql_name } .graphql"
6066 end
Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ class Thing < GraphQL::Schema::Object
2323 def str ; "blah" ; end
2424 end
2525
26+ class Named < GraphQL ::Schema ::Union
27+ possible_types Thing
28+ def self . resolve_type ( obj , ctx )
29+ Thing
30+ end
31+ end
32+
2633 class Query < GraphQL ::Schema ::Object
2734 include GraphQL ::Types ::Relay ::HasNodeField
2835
@@ -34,6 +41,8 @@ def int
3441
3542 field :thing , Thing
3643 def thing ; :thing ; end
44+
45+ field :named , Named , resolver_method : :thing
3746 end
3847
3948 class TestSchema < GraphQL ::Schema
@@ -47,7 +56,7 @@ class TestSchema < GraphQL::Schema
4756 end
4857
4958 it "traces events" do
50- _res = AppsignalTraceTest ::TestSchema . execute ( "{ int thing { str } }" )
59+ _res = AppsignalTraceTest ::TestSchema . execute ( "{ int thing { str } named { ... on Thing { str } } }" )
5160 expected_trace = [
5261 "execute.graphql" ,
5362 "analyze.graphql" ,
@@ -59,7 +68,10 @@ class TestSchema < GraphQL::Schema
5968 "Query.authorized.graphql" ,
6069 "Query.thing.graphql" ,
6170 "Thing.authorized.graphql" ,
62- "execute.graphql"
71+ "Query.named.graphql" ,
72+ "Named.resolve_type.graphql" ,
73+ "Thing.authorized.graphql" ,
74+ "execute.graphql" ,
6375 ]
6476 assert_equal expected_trace , Appsignal . instrumented
6577 end
You can’t perform that action at this time.
0 commit comments