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

Add client to Query's QueryResult #1488

Merged
merged 7 commits into from
Dec 29, 2017

Conversation

rosskevin
Copy link
Contributor

@rosskevin 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

@apollo-cla
Copy link

apollo-cla commented Dec 28, 2017

Warnings
⚠️

❗ Big PR

Generated by 🚫 dangerJS

@rosskevin
Copy link
Contributor Author

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

@rosskevin
Copy link
Contributor 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
Copy link
Contributor

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
Copy link
Contributor Author

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 rosskevin merged commit b47752c into apollographql:master Dec 29, 2017
@rosskevin rosskevin deleted the query-result-client branch December 29, 2017 13:29
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