Hey everyone! So for the last few weeks I’ve been ...
# orm-help
p
Hey everyone! So for the last few weeks I’ve been designing and beginning to implement a GraphQL API using Prisma. I’m at a stage where I have enough of an API foundation to think about developing frontend. I’ll be using react-native and I have a few questions regarding fetching data from my API. I want to be able to provide users with an offline experience and therefore require cache. I also want to use subscriptions (real-time functionality in GraphQL). I’ve found Apollo Client and seen that it has a lot of good reviews, however, I’m not a huge fan of the built in React components that display the data. I haven’t used them so I can’t really be sure that I don’t like them, however I don’t think they’ll be great for query testing which isn’t a huge deal since I’ll be thoroughly testing my API and Prisma is tested. On the other hand I’ve used redux in the past and am wondering if it has the possibly of acting as a sort of cache when paired with simple https requests. Any thoughts are appreciated! 🙏
r
Hey Philipp 👋 In my personal opinion, Apollo Client would be a much better fit than Redux as a starter as it provides built-in components for all GraphQL operations and also local state support out of the box. As for Redux, you would have to call the GraphQL API yourself using some other library and manage that state differently. Another problem is that manual caching for GraphQL request is quite difficult as they are not simple GET requests but POST requests with specific queries. So caching would be difficult in that case. For ease of use, I would personally recommend going for Apollo over Redux as Apollo is tailored for GraphQL use-cases.
p
Thank you!
👍 1