ParserCache
Add LRU caching the parsing step during execution to improve performance.
Example:
import strawberryfrom 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:
-
maxsize:
Set the maxsize of the cache. If
maxsize
is set toNone
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:
-
on_parse
Signature:
def on_parse(self) -> Iterator[None]:...
Attributes:
-
cached_parse_document: