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
{{ message }}
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
I have defined an own Instrumentation, which overrides method instrumentExecutionContext to provide a customized ExecutionContext prior query execution.
class ExecutionContextInstrumentation extends SimpleInstrumentation {
@Override
public ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters) {
...
return myExecutionContext;
}
}
@Service
class InstrumentationService {
@Bean
List<Instrumentation> instrumentations() {
return new ArrayList<>(List.of(new ExecutionContextInstrumentation());
}
}
This works perfectly fine when executing GraphQL queries and mutations. However, that method is not called when I execute a subscription. It's working for subscriptions though, if I execute my code outside of the Spring context, e.g. in a plain-vanilla JUnit test. So it does not seem to be a bug in graphql-java, but in the graphql-java-kickstart, which does not take my instrumentation bean for subscriptions.
So to make it clear: This plain graphql-java code works fine for subscriptions as well.
But within the context of graphql-spring-boot I have no way to set the instrumentations explicitly. I have to define a bean of type List<Instrumentation>, which returns the instrumentations. The framework then cares about the wiring.