ValidationCache
Add LRU caching the validation step during execution to improve performance.
Example:
import strawberryfrom strawberry.extensions import ValidationCache
schema = strawberry.Schema( Query, extensions=[ ValidationCache(maxsize=100), ],)
Constructor:
Initialize the ValidationCache.
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.- Type
-
int | None
- Default
-
None
Methods:
-
on_validate
Signature:
def on_validate(self) -> Iterator[None]:...
Attributes:
-
cached_validate_document: