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
Any guidance how to write an exchange that suspends all fetch requests until a promise has been resolved?
I played around with this for a few hours.
Essentially I was unable to delay operations in the pipe until the token was available. I tried to subscribe to the original data and then sending it back out using a makeSubject. However due to the key tracking the requests ended up being marked as completed as they were removed from the original pipe.
The text was updated successfully, but these errors were encountered:
You could also create a contextExchange (similar to apollo-link-context, if I'm not mistaken) that allows you to change every operation's context as part of the exchange pipeline. If you put this exchange just before the fetchExchange you don't even have to modify our exchange to make this work. https://gist.github.com/kitten/df34c06e56d6fb0d04159e26f3e12506
We might actually ship this exchange as part of urql or a secondary @urql/ package in the future.
(I haven't tested it but just quickly jotted down the idea of how it'd work)
Ref #326
Any guidance how to write an exchange that suspends all fetch requests until a promise has been resolved?
I played around with this for a few hours.
Essentially I was unable to delay operations in the pipe until the token was available. I tried to subscribe to the original data and then sending it back out using a makeSubject. However due to the key tracking the requests ended up being marked as completed as they were removed from the original pipe.
The text was updated successfully, but these errors were encountered: