strawberry.extensions.ParserCache

Add LRU caching the parsing step during execution to improve performance.

Example:

import strawberry
from strawberry.extensions import ParserCache
schema = strawberry.Schema(
Query,
extensions=[
ParserCache(maxsize=100),
],
)

Constructor:

Initialize the ParserCache.

Signature:

def __init__(self, maxsize: int | None = None) -> None:
...

Parameters:

  1. maxsize:

    Set the maxsize of the cache. If maxsize is set to None then the cache will grow without bound. More info: https://docs.python.org/3/library/functools.html#functools.lru_cache

    Type
    int | None
    Default
    None

Methods:

Attributes:

  1. cached_parse_document: