Closed as not planned
Closed as not planned
Description
On my controllers my code propagates values via local context, so something like this.
@SchemaMapping(typeName = "Foo", field = "bar")
public List<Bar> getBars(DataFetchingEnvironment env) {
var localContext = (GraphQLContext) Objects.requireNonNull(env.getLocalContext());
...
localContext.put("BAR_ID", service.getValue(bar.getId()));
...
}
@SchemaMapping(typeName = "Bar", field = "name")
public String getBarName(DataFetchingEnvironment env) {
var localContext = (GraphQLContext) Objects.requireNonNull(env.getLocalContext());
...
var barId = (String) localContext.get("BAR_ID");
...
}
Which worked fine for my use-case.
But I noticed that my code breaks when I activate spring-actuator.
To elaborate, the local context would no longer have my values, and only contain 'micrometer.observation' values.
var barId = (String) localContext.get("BAR_ID"); // null
I read the documentations regarding contexts and observability but failed to find a fix.
I was wondering if this was intentional and I need some additional configuration to make my code work.
I haven't tested with global context values.