strawberry.extensions.ValidationCache

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

Example:

import strawberry
from 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:

  1. maxsize:

    Set the maxsize of the cache. If maxsize is set to None then the cache will grow without bound.

    Type
    int | None
    Default
    None

Methods:

Attributes:

  1. cached_validate_document: