Open hajnalben opened 1 month ago
Would you create a reproduction?
See the race1.ts and race2.ts in the repo. Run them separately and see the difference.
They are executing the same query with different variables (A -> B | B -> A).
You could debug the installed "@graphql-mesh/runtime": "0.99.7"
in the node_modules and see the missfunctionality of the cache I described above.
Also fixed it locally and based on that I have created the PR.
The caching part of the code for transformed documents in the legacy runtime is totally inaccurate. It doesn't prevent the call of
applyRequestTransforms
but instead of it overwrites its result.Source: packages/legacy/runtime/src/useSubschema.ts
The code below is copied from the master branch (
"version": "0.99.7"
)As you can see the
applyRequestTransforms
is called every time without checking the cache for match. After that the transformed document will be overwritten by the cache result. Also the caching logic doesn't consider transformers that produce different transformed documents based on theoriginalRequest.variables
(example: @graphprotocol/client-auto-pagination)