srtucker22 / chatty

A WhatsApp clone with React Native and Apollo (Tutorial)
https://medium.com/@simontucker/building-chatty-a-whatsapp-clone-with-react-native-and-apollo-part-1-setup-68a02f7e11
MIT License
500 stars 110 forks source link

apollo-client v2 #23

Closed srtucker22 closed 6 years ago

srtucker22 commented 6 years ago

Upgrade the entire tutorial to latest version of apollo-client.

apollo-client v2 no longer uses Redux for caching GraphQL data, so there is currently no good dev tooling for Apollo 2 with React Native (there’s no Apollo DevTools for React Native). Once there are adequate dev tools for Apollo 2 with React Native, update the whole tutorial!

Relevant issues: https://github.com/apollographql/apollo-client/issues/2509 https://github.com/apollographql/apollo-client-devtools/issues/6

Karsens commented 6 years ago

Hey Simon, can you elaborate your solution to having dev tooling with apollo 2? I struggled with it the whole day today, but google wasn't of much help! Seems you did it!

srtucker22 commented 6 years ago

Apollo DevTools still hasn't made its way to React Native. However, there are 2 Redux packages for Apollo 2 built by the community -- apollo-cache-redux and apollo-link-redux -- that will make all Apollo actions flow through Redux and store all queries/mutations/subscriptions and corresponding responses in Redux. I think the tooling ecosystem around Redux is very mature and would probably prefer using it over Apollo DevTools anyway.

I've incorporated these packages in Chatty in Part 1 so feel free to check out how that's implemented in the tutorial and let me know if you have any questions!

Karsens commented 6 years ago

Thanks, Simon, really appreciate this tutorial series!