Caching attribute on query resolver
manhtd98 opened this issue · comments
Misha Tran commented
I have a query that calculates 1 value on each resolver value like this:
class ProductType(ObjectType):
product = graphene.GlobalID(required=True)
@staticmethod
def resolve_products(root, info):
q = calculate()
def resolve_item(root, info):
q = calculate()
Have some method to calculate only 1 time and cache it on the resolver.