Closed Undistraction closed 11 months ago
Yes, extra variables are always present before an operation is sent onwards to the exchange that'll send it to the API. However, after forwarding these variables will be filtered.
The code you link unfortunately has no relation to this. The operation
variable there isn't an Operation
type of @urql/core
bit is rather an OperationDefinitionNode
.
We're probably missing an operations.get
call however to retrieve the prior operation with unchanged variables. I'll have to check this out more closely though, since there's been a few additional changes since this was introduced
@kitten yeah. Sorry. Deleted that update as I realised I'd gone down the wrong path.
I have confirmed that:
writeSelection
is called (from updateCacheWithResult
), the operation has been mutated (I compared the operation keys) and the additional variables are no longer present.In case it's useful, here are the upgrades that caused the issue. Guessing it's the graphcache bump:
@urql/exchange-retry 1.2.0 No change
@urql/exchange-graphcache 6.1.4 => 6.3.1
@urql/exchange-auth 2.14 => 2.1.6
@urql/core 4.0.10 => 4.1.1
urql 4.04 => 4.0.5
Describe the bug
I've just upgraded URQL to the latest packages, and I'm no longer receiving the extra arguments (documentation) that I pass in to a mutation in the Graphcache's
updates
. The arguments used by the query are still present, but the additional arguments are not.Mutation:
Relevant graphcache config:
Using the map exchange I have confirmed that the additional variable is present on the operation before it reaches the graphcache-exchange. I've also added some logging and confirmed that the variable is present when it is first processed by the graphcache-exchange.
Reproduction
To follow
Urql version
Validations