-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Hey there, just came across this library while investigating my own issues with AsyncLocalStorage losing context inside graphql interceptors.
I'm not (yet) using this library, I have a custom implementation, but I wanted to mention that I eventually got it working via this pattern in the interceptor:
intercept(...) {
return new Observable((observer) => {
storage.run(myContext, () => {
next
.handle()
.pipe(...)
.subscribe({
next: (res) => observer.next(res),
error: (error) => observer.error(error),
complete: () => observer.complete(),
});
});
});
}Seems that wrapping the return in a cold observable is necessary, but this is all that I needed to do.
With this I can use run instead of enterWith, which I noticed was mentioned as a caveat in the readme about not being supported.
Papooch
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request