Skip to content

Exchanges overwriting request headers #3388

Answered by JoviDeCroock
rrva asked this question in Q&A
Discussion options

You must be logged in to vote

I quickly created a preproduction but without all the extra exchanges, this worked correctly for me... I however did notice that the const context = trace.setSpanContext(ROOT_CONTEXT, operation.context.span.spanContext()); is creating a new operation in appendHeaders but that operation is never returned to the exchange so either you would resort to mutating in the appendHeaders method or you return the operation created there to the exchange.

A few additional pointers here

  • The dedupExchange isn't needed anymore in the latest urql versions (are you using those)
  • Why are you using two fetch exchanges? Only one should be sufficient
  • Placing the errorExchange after the cache should catch all t…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rrva
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants