graphql-python / graphql-python/graphene-django

Caching attribute on query resolver

Open
#1,467 0 comments 0 reactions 0 assignees View on GitHub
🐛bug
Dominant language
Python
Stars
4.4k
Forks
760
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.