1

I've developed a graphql server (using graphql-yoga), my GraphQL client is Relay and I've set up a cache in Relay Network layer as well (see the doc).

My GraphQL server is just a layer on top of REST API. Does it make sense for me try to add DataLoader as well?

Update: from Apollo Docs:

Although DataLoader is great for that use case, it’s less helpful when loading data from REST APIs because its primary feature is batching, not caching. What we’ve found to be far more important when layering GraphQL over REST APIs is having a resource cache that saves data across multiple GraphQL requests, can be shared across multiple GraphQL servers, and has cache management features like expiry and invalidation that leverage standard HTTP cache control headers.

A. Karnaval
  • 727
  • 2
  • 8
  • 12

0 Answers0