0
votes

I have a redux application that fetches data from a Graphql server. I am currently using a lightweight Graphql client called graphql-request, and all it does is help you send Graphql queries/mutations, but I would like to get the best out of my APIs. even though I am using Redux as state management, is it ok to use apollo-client without its built-in cache and use it only for network requests/ API calls?

Benefits I know I would get from using apollo-client include:

  1. Better error handling
  2. Better implementation of auto-refreshing tokens
  3. Better integration with my server, since my server is written apollo-server

Thanks

1
What type of questions should I avoid asking?: If your motivation for asking the question is “I would like to participate in a discussion about ______”, then you should not be asking here.Damien_The_Unbeliever
you can use apollo for data fetching and redux for app state (it was designed for) ... use cache, find out why laterxadm

1 Answers

0
votes

Apollo-client's built-in cache does pretty much the same job that redux state management would do for your application. Obviously, if you are not comfortable with it, you can use redux to implement the functionality that you need, but the best case scenario in my opinion would be to drop redux, since the configuration of it its pretty heavy, and rely purely on the cache provided by Apollo-client.