Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Fix newData raising error per #3455 issue #3539

Merged
merged 2 commits into from Oct 1, 2019

Conversation

pawelkleczek
Copy link
Contributor

This PR attempts to fix issue #3455 by splittting destructuring result after newData is retrieved:

-    const { result, error, delay, newData } = response;
+    const { newData } = response;

     if (newData) {
       response.result = newData();
       this.mockedResponsesByKey[key].push(response);
     }

+    const { result, error, delay } = response;
+
     if (!result && !error) {
       throw new Error(
         `Mocked response should contain either result or error: ${key}`

@apollo-cla
Copy link

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

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pawelkleczek!

@hwillson hwillson merged commit 1658435 into apollographql:master Oct 1, 2019
hwillson added a commit to apollographql/apollo-client that referenced this pull request Oct 2, 2019
hwillson added a commit to apollographql/apollo-client that referenced this pull request Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants