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

Use standby fetchPolicy for recycled queries #671

Merged
merged 7 commits into from
May 3, 2017

Conversation

jacobk
Copy link
Contributor

@jacobk jacobk commented May 1, 2017

See #622

TODO:

});
break;
case 2:
// // TODO: Proper assertions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@helfer I noticed that the recycled component is rendered twice after being recycled and rendered again. Is this to be expected?

Copy link
Contributor

Choose a reason for hiding this comment

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

It depends. Maybe it renders twice because it tries to do a network fetch? Or does it render twice with the same parameters?

Copy link
Contributor Author

@jacobk jacobk May 1, 2017

Choose a reason for hiding this comment

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

Props are visually identical but apollo data-functions are changed due to observableQueryFields that seems to be invoked a couple of times between renders. I haven't studied that in detail but seems unrelated to this test-case.

@jacobk
Copy link
Contributor Author

jacobk commented May 1, 2017

I'm pretty happy with the current test case. Should be an easy fix once standby lands in apollo-client.

@jacobk
Copy link
Contributor Author

jacobk commented May 3, 2017

@helfer I noticed that apollo-client with standby is released. I've updated this PR to use standby and tried it against apollo-client 1.1.2 and all tests seems to pass.

Should be ready to merge once rebased after react-apollo upgrades apollo-client.

EDIT

Hmm, also seems to pass above, the TS shouldn't compile?

EDIT2

Ah, apollo-client is a caret range dep so it picks up the new apollo-client 👍

@jacobk jacobk changed the title WIP: Use standby fetchPolicy for recycled queries Use standby fetchPolicy for recycled queries May 3, 2017
@jbaxleyiii
Copy link
Contributor

@jacobk can you rebase this, and update the changelog and package.json file to force ^1.1.2 of apollo-client? I'd love to merge this in and release it!

Thank you for the great tests!

@jacobk
Copy link
Contributor Author

jacobk commented May 3, 2017

@jbaxleyiii no problem! Should be done now.

@helfer
Copy link
Contributor

helfer commented May 3, 2017

Nice, I'm looking forward to seeing this released in the wild @jacobk @jbaxleyiii !

@jbaxleyiii jbaxleyiii merged commit e12fbb1 into apollographql:master May 3, 2017
@jbaxleyiii
Copy link
Contributor

@helfer @jacobk same! I'll release tonight!

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.

3 participants