graphql-python / graphql-python/graphene-django
Caching attribute on query resolver
Open
🐛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
Assessment
This issue has not been assessed yet.