How to cache the result of resolver chains #6378
Unanswered
itssamuelrowe
asked this question in
Q&A
Replies: 1 comment
-
This is what DataLoader is designed for: https://www.npmjs.com/package/dataloader |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
Let's say I have a schema like this:
The equivalent resolvers would be:
I am trying to fetch 100
Transaction
objects all pointing to the sameAccount
object. Apollo invokes the chain resolverTransaction.account
100 times despite the account being the same.Do I have to manually implement a caching strategy? Or is Apollo Server capable of doing this? If yes, how do I implement it?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions