Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observation instrumentation assumes local context is a GraphQLContext #918

Closed
bclozel opened this issue Feb 23, 2024 · 0 comments
Closed
Assignees
Labels
in: core Issues related to config and core support type: bug A general bug
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Feb 23, 2024

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.

@bclozel bclozel added type: bug A general bug in: core Issues related to config and core support labels Feb 23, 2024
@bclozel bclozel added this to the 1.2.6 milestone Feb 23, 2024
@bclozel bclozel self-assigned this Feb 23, 2024
@bclozel 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
@bclozel bclozel closed this as completed in 0fa2c4f Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues related to config and core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant