caching the result of an expensive computation/rpc-call in a GraphQLResolver #750
Unanswered
kurtseebauer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I have a GraphQLResolver like this (in Kotlin):
and then some of the graphql properties are calculated in an external service call, like
Now my question is, how do I best store the
service.compute(e)
as a cached result? Do I put it in the graphql context? Do I have to deal with double checked locking and stuff like that myself or is there a better way? I want to avoid computing multiple times, and I want to avoid putting transient fields (maybe aby lazy
property) in the jpa entity.Thank you for any hints!
Beta Was this translation helpful? Give feedback.
All reactions