Skip to content

Observation instrumentation assumes local context is a GraphQLContext #918

Closed
@bclozel

Description

@bclozel

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues related to config and core supporttype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions