Relay vs Redux vs Apollo with GraphQL and React-Native [closed]

蹲街弑〆低调 提交于 2019-12-02 17:09:41

I think if you're coming from a React + Redux background, then Apollo should be the way to go for you!

Note: If you're a complete newcomer to GraphQL, I recommend you check out How to GraphQL where you'll find tutorials both on Relay and Apollo.

A few pieces of information:

  • Relay is very powerful but also extremely complex and comes with a notable learning curve.
  • Apollo builds on top of Redux though that's not really relevant for you as a developer, because the store is hidden from you. However, similar concepts as in Redux are used e.g. for updating the store with updateQueries.
  • It's also pretty straightfoward to combine the Apollo store with your own Redux store if you want to manage state other than the cached data from the server
  • With Apollo, you can also use realtime subscriptions
  • I would definitely recommend against not using Apollo or Relay and going with only Redux since both frameworks take notable work off your shoulders when it comes to sending queries, mutations, caching and UI updates. However, you might want to take a look at Lokka if you're looking for a more lightweight GraphQL client.

Take a look at this in-depth article comparing Relay and Apollo for more background info.

If you want to learn more about Relay and Apollo, check out the How to GraphQL tutorial website.

By the way, another option for the backend if you don't want to build it yourself would be Graphcool (disclaimer: I work for them :)).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!