Replies: 1 comment 2 replies
-
What extra data do your want to attach? Is this to be expressed as graphql data? eg it starts as if so why not use eg use Flux mapping not graphql interception? You can "instrument the DataFecther" such that you will always see "flux values" coming from the DataFetcher
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
My use case is that I need to attach some extra information to each individual subscription event produced by the publisher in my data fetcher. This is to perform some tasks once the event has been successfully mapped to an execution result and is ready to be delivered to the client.
The publisher comes from another part of the application as a
Flux
, so my idea was to transform emitted elements by wrapping them in aDataFetcherResult
, where I put exactly what I need in the local context. And then use anInstrumentation
with thebeginSubscribedFieldEvent
method, and perform my tasks in theonComplete
callback. I could of course do it once the event has left the engine as well but at that point I only have the finalExecutionResult
(?).It seems we don't have access to local context in the instrumentation method. I see in
SubscriptionExecutionStrategy
that a newExecutionContext
is prepared for each event, however it's the overall execution context that is passed to the parameters. But that alone won't be enough sinceunboxPossibleDataFetcherResult
happens after the instrumentation is called (though I could do it myself if I have the root eventPayload).Am I missing something and/or does anyone have any other ideas how to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions