-
I'm new to urql so not ruling out that I've made a mistake somewhere... For background, I'm building a NextJS app with next-urql. Initially, I implemented an authExchange (JWT) based on this gist: https://gist.github.com/kitten/6050e4f447cb29724546dd2e0e68b470. All worked fine. Some time after switching to the official exchange-auth package I noticed my backend receiving duplicate mutations (what tipped me off were the primary key violations on registering new users). Urql devtools has since confirmed that all of my queries/mutations are firing off in duplicate; one execution command resulting in two results within milliseconds of each other, all identical keys. In a process of elimination, I discovered that the duplicate operations(?) only occur when using the new exchange-auth package. I'd post my authExchange config but it's practically identical to the documented example, other than minor implementation details such as how I get/set my access token, identify auth errors and log users out. So I'm at a loss here. Is there anything I can do to debug further? Btw, this is what my exchanges looks like: [devtoolsExchange, dedupExchange, cache, retryExchange(options), errorExchange, fetchOptions(ctx), authExchange({/* auth config */}), ssrExchange, fetchExchange]. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
That's pretty odd! Can you post a small code snippet of your |
Beta Was this translation helpful? Give feedback.
-
I've just opened a PR to fix this issue and I believe I've tracked down what's causing this. #1075 If you don't mind, you can test this out for me by installing it from Codesandbox CI ❤️ Basically just set the version in your |
Beta Was this translation helpful? Give feedback.
I've just opened a PR to fix this issue and I believe I've tracked down what's causing this. #1075
If you don't mind, you can test this out for me by installing it from Codesandbox CI ❤️ Basically just set the version in your
package.json
for@urql/exchange-auth
to"https://pkg.csb.dev/FormidableLabs/urql/commit/791f05aa/@urql/exchange-auth"