strawberry.fastapi.GraphQLRouter

Constructor:

Signature:

def __init__(
self,
schema: BaseSchema,
path: str = '',
graphiql: bool | None = None,
graphql_ide: GraphQL_IDE | None = 'graphiql',
allow_queries_via_get: bool = True,
keep_alive: bool = False,
keep_alive_interval: float = 1,
debug: bool = False,
root_value_getter: Callable[[], RootValue] | None = None,
context_getter: Callable[..., Context | None] | None = None,
subscription_protocols: Sequence[str] = (GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL),
connection_init_wait_timeout: timedelta = timedelta(ExprKeyword),
prefix: str = '',
tags: List[str | Enum] | None = None,
dependencies: Sequence[params.Depends] | None = None,
default_response_class: Type[Response] = Default(JSONResponse),
responses: Dict[int | str, Dict[str, Any]] | None = None,
callbacks: List[BaseRoute] | None = None,
routes: List[BaseRoute] | None = None,
redirect_slashes: bool = True,
default: ASGIApp | None = None,
dependency_overrides_provider: Any | None = None,
route_class: Type[APIRoute] = APIRoute,
on_startup: Sequence[Callable[[], Any]] | None = None,
on_shutdown: Sequence[Callable[[], Any]] | None = None,
lifespan: Lifespan[Any] | None = None,
deprecated: bool | None = None,
include_in_schema: bool = True,
generate_unique_id_function: Callable[[APIRoute], str] = Default(generate_unique_id),
kwargs: Any = {},
) -> None:
...

Parameters:

  1. schema:

    Type
    BaseSchema
  2. path:

    Type
    str
    Default
    ''
  3. graphiql:

    Type
    bool | None
    Default
    None
  4. graphql_ide:

    Type
    GraphQL_IDE | None
    Default
    'graphiql'
  5. allow_queries_via_get:

    Type
    bool
    Default
    True
  6. keep_alive:

    Type
    bool
    Default
    False
  7. keep_alive_interval:

    Type
    float
    Default
    1
  8. debug:

    Type
    bool
    Default
    False
  9. root_value_getter:

    Type
    Callable[[], RootValue] | None
    Default
    None
  10. context_getter:

    Type
    Callable[..., Context | None] | None
    Default
    None
  11. subscription_protocols:

    Type
    Sequence[str]
    Default
    (GRAPHQL_TRANSPORT_WS_PROTOCOL, GRAPHQL_WS_PROTOCOL)
  12. connection_init_wait_timeout:

    Type
    timedelta
    Default
    timedelta(ExprKeyword)
  13. prefix:

    Type
    str
    Default
    ''
  14. tags:

    Type
    List[str | Enum] | None
    Default
    None
  15. dependencies:

    Type
    Sequence[params.Depends] | None
    Default
    None
  16. default_response_class:

    Type
    Type[Response]
    Default
    Default(JSONResponse)
  17. responses:

    Type
    Dict[int | str, Dict[str, Any]] | None
    Default
    None
  18. callbacks:

    Type
    List[BaseRoute] | None
    Default
    None
  19. routes:

    Type
    List[BaseRoute] | None
    Default
    None
  20. redirect_slashes:

    Type
    bool
    Default
    True
  21. default:

    Type
    ASGIApp | None
    Default
    None
  22. dependency_overrides_provider:

    Type
    Any | None
    Default
    None
  23. route_class:

    Type
    Type[APIRoute]
    Default
    APIRoute
  24. on_startup:

    Type
    Sequence[Callable[[], Any]] | None
    Default
    None
  25. on_shutdown:

    Type
    Sequence[Callable[[], Any]] | None
    Default
    None
  26. lifespan:

    Type
    Lifespan[Any] | None
    Default
    None
  27. deprecated:

    Type
    bool | None
    Default
    None
  28. include_in_schema:

    Type
    bool
    Default
    True
  29. generate_unique_id_function:

    Type
    Callable[[APIRoute], str]
    Default
    Default(generate_unique_id)
  30. kwargs:

    Type
    Any
    Default
    {}

Methods:

Attributes:

  1. graphql_ws_handler_class:

  2. graphql_transport_ws_handler_class:

  3. allow_queries_via_get:

  4. request_adapter_class:

  5. schema:

  6. keep_alive:

  7. keep_alive_interval:

  8. debug:

  9. root_value_getter:

  10. context_getter:

  11. protocols:

  12. connection_init_wait_timeout:

  13. graphql_ide: