Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching attribute on query resolver #1467

Open
manhtd98 opened this issue Oct 1, 2023 · 0 comments
Open

Caching attribute on query resolver #1467

manhtd98 opened this issue Oct 1, 2023 · 0 comments
Labels

Comments

@manhtd98
Copy link

manhtd98 commented Oct 1, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant