You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, our GraphQlObservationInstrumentation wraps the local GraphQLContext when passing it on to the next child DataFetcher in order to set the current observation in the context with the ObservationThreadLocalAccessor.KEY key.
While graphql.GraphQLContext is a popular choice of context implementation, DataFetcher can choose to use custom types that do not extend this type.
We should relax this requirement and make sure to contribute only if the local context in DataFetchingEnvironment is null or if it is already an instance of GraphQLContext.
The text was updated successfully, but these errors were encountered:
bclozel
changed the title
Observation instrumentation wrongly assumes that data fetcher context is a GraphQLContext
Observation instrumentation assumes local context is a GraphQLContext
Feb 23, 2024
Currently, our
GraphQlObservationInstrumentation
wraps the localGraphQLContext
when passing it on to the next childDataFetcher
in order to set the current observation in the context with theObservationThreadLocalAccessor.KEY
key.While
graphql.GraphQLContext
is a popular choice of context implementation,DataFetcher
can choose to use custom types that do not extend this type.We should relax this requirement and make sure to contribute only if the local context in
DataFetchingEnvironment
isnull
or if it is already an instance ofGraphQLContext
.The text was updated successfully, but these errors were encountered: