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

Add `client` to `Query`'s `QueryResult` #1488

Merged
merged 7 commits into from Dec 29, 2017

Conversation

Projects
None yet
3 participants
@rosskevin
Copy link
Collaborator

rosskevin commented Dec 28, 2017

  • Add client to Query's QueryResult to prevent the need for query + mutation components to need to require either ApolloConsumer or withApollo
  • Add test for client in QueryResult
  • Rename script testonly to jest
  • Regenerate snapshot as they didn't include client
  • Reorganize Query.test based on grouped describe contexts

grouping

@rosskevin rosskevin requested a review from excitement-engineer Dec 28, 2017

@meteor-bot

This comment has been minimized.

Copy link

meteor-bot commented Dec 28, 2017

Warnings
⚠️

❗️ Big PR

Generated by 🚫 dangerJS

@rosskevin rosskevin referenced this pull request Dec 28, 2017

Closed

500 error #190

@rosskevin

This comment has been minimized.

Copy link
Collaborator Author

rosskevin commented Dec 28, 2017

bundlesize is currently failing, will probably be back up soon - siddharthkp/bundlesize#190

@rosskevin

This comment has been minimized.

Copy link
Collaborator Author

rosskevin commented Dec 28, 2017

Someone needs to hit rebuild on travis later. This is good to go.

EDIT: seems like the build allowed it regardless of bundlesize.

@excitement-engineer

This comment has been minimized.

Copy link
Collaborator

excitement-engineer commented Dec 29, 2017

I'm wondering if it is really necessary to add the client to the render prop, is it really that awkward to add an withApollo or ApolloConsumer for those cases where someone wants to do a query + mutation?

The improvements to the test are great! Thanks so much, it is organized much better now:)

@rosskevin

This comment has been minimized.

Copy link
Collaborator Author

rosskevin commented Dec 29, 2017

Yes, it is a big improvement for me (my code is already converted). I have several render call backs so just another adds to the nesting, and with 30 components that are mutations + queries, it's just more cruft when I know the client is there.

The beauty of this pattern is that the user can take or leave it. They can choose to destructure it here or from ApolloConsumer.

rosskevin added some commits Dec 29, 2017

@rosskevin rosskevin merged commit b47752c into apollographql:master Dec 29, 2017

4 checks passed

CLA Author has signed the Meteor CLA.
Details
bundlesize ./lib/umd/react-apollo.js: 4.66KB < maxSize 4.7KB gzip (2B larger than master, careful!)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.007%) to 96.104%
Details

@rosskevin rosskevin deleted the rosskevin:query-result-client branch Dec 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment