apollo-link-persisted-queries icon indicating copy to clipboard operation
apollo-link-persisted-queries copied to clipboard

Add ignoreOperations to not persist specific operations

Open declanelcocks opened this issue 7 years ago • 3 comments
trafficstars

What does it do? Allows ignoreOperations to specify an array of operations to ignore when persisting requests.

Why? I came across an issue https://github.com/apollographql/apollo-link-persisted-queries/issues/12 with persisted queries and apollo-upload-client where the retried file upload would not include the files from the original request.

There were some ideas thrown around here, but with no concrete solution. As the author pointed out, the issue comes from the fact that the library mutates the operation and the retry request does not have the correct payload.

Since this issue appeared to be unique to uploading files like this, I chose to add ignoreOperations to specify an Array of operations to ignore.

Let me know if there's any improvements to be made, or if my approach is not worthwhile.

declanelcocks avatar Sep 06 '18 07:09 declanelcocks

@declanelcocks: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

apollo-cla avatar Sep 06 '18 07:09 apollo-cla

Codecov Report

Merging #22 into master will decrease coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   98.76%   98.75%   -0.02%     
==========================================
  Files           2        2              
  Lines          81       80       -1     
  Branches       23       19       -4     
==========================================
- Hits           80       79       -1     
  Misses          1        1
Impacted Files Coverage Δ
src/index.ts 98.73% <100%> (-0.02%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 974edc3...8857e6d. Read the comment docs.

codecov-io avatar Sep 06 '18 07:09 codecov-io

Not sure on why Travis is failing as the failed build is not a result of my changes. It appears to be a result of some of the current tests timing out.

declanelcocks avatar Sep 06 '18 07:09 declanelcocks