New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression on 2.1.0-rc.3: refetchQueries throw errors on unknown queries #1794

Merged
merged 2 commits into from Mar 15, 2018

Conversation

Projects
None yet
3 participants
@vincentdesmares
Copy link
Contributor

vincentdesmares commented Mar 15, 2018

When we are searching a query to refetch, we must take care to return the operation, if it exists, else we must return the original string.
The code in apollo-client does not handle a query equal to "undefined" but takes care of the string if properly forwarded to. See the related code L254.

How to reproduce the bug:

  • provide a unknown query as a string in the mutation options. (ex: refetchQueries: ['test'])
  • Run the mutation
  • Instead of ignoring the query as expected, Apollo with throw an error: "Uncaught TypeError: Cannot read property 'query' of undefined at QueryManager.js:143"

vincentdesmares added some commits Mar 15, 2018

Fix an error when a refetchQuery wasn't defined
When we are seeking to find a query to refetch. We must take care to return the operation, if it exists, else we must return the original string.
The code in apollo-client does not handle a query equal to "undefined" but takes care of the string if properly forwarded to. See ahttps://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/QueryManager.ts l254.
Merge pull request #1 from vincentdesmares/vincentdesmares-patch-refe…
…tch-query-undefined

Fix an error when a refetchQuery wasn't defined
@meteor-bot

This comment has been minimized.

Copy link

meteor-bot commented Mar 15, 2018

@vincentdesmares: 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/

@jbaxleyiii jbaxleyiii merged commit 73408df into apollographql:master Mar 15, 2018

4 checks passed

CLA Author has signed the Meteor CLA.
Details
bundlesize ./dist/bundlesize.js: 10.53KB < maxSize 11KB (gzip)(2B smaller than master, good job!)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 96.734%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment