File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -95,18 +95,23 @@ def _request_info_from_transport(
9595def _patch_execute () -> None :
9696 real_execute = gql .Client .execute
9797
98+ # Maintain signature for backwards compatibility.
99+ # gql.Client.execute() accepts a positional-only "request"
100+ # parameter with version 4.0.0.
98101 @ensure_integration_enabled (GQLIntegration , real_execute )
99102 def sentry_patched_execute (
100103 self : "gql.Client" ,
101- document_or_request : "DocumentNode" ,
104+ document : "DocumentNode" ,
102105 * args : "Any" ,
103106 ** kwargs : "Any" ,
104107 ) -> "Any" :
105108 scope = sentry_sdk .get_isolation_scope ()
106- scope .add_event_processor (_make_gql_event_processor (self , document_or_request ))
109+ # document is a gql.GraphQLRequest with gql v4.0.0.
110+ scope .add_event_processor (_make_gql_event_processor (self , document ))
107111
108112 try :
109- return real_execute (self , document_or_request , * args , ** kwargs )
113+ # document is a gql.GraphQLRequest with gql v4.0.0.
114+ return real_execute (self , document , * args , ** kwargs )
110115 except TransportQueryError as e :
111116 event , hint = event_from_exception (
112117 e ,
You can’t perform that action at this time.
0 commit comments