strawberry.interface

Annotates a class as a GraphQL Interface.

Similar to @strawberry.type , but for interfaces.

Returns:

The class.

Signature:

def interface(
cls: T | None = None,
name: str | None = None,
description: str | None = None,
directives: Sequence[object] | None = (),
) -> :
...

Parameters:

  1. name:

    The name of the GraphQL interface.

    Type
    str | None
    Default
    None
  2. description:

    The description of the GraphQL interface.

    Type
    str | None
    Default
    None
  3. directives:

    The directives of the GraphQL interface.

    Type
    Sequence[object] | None
    Default
    ()