create_type

Create a Strawberry type from a list of StrawberryFields.

Signature:

def create_type(
name: str,
fields: List[StrawberryField],
is_input: bool = False,
is_interface: bool = False,
description: str | None = None,
directives: Sequence[object] | None = (),
extend: bool = False,
) -> Type:
...

Parameters:

  1. name:

    The GraphQL name of the type.

    Type
    str
  2. fields:

    The fields of the type.

    Type
    List[StrawberryField]
  3. is_input:

    Whether the type is an input type.

    Type
    bool
    Default
    False
  4. is_interface:

    Whether the type is an interface.

    Type
    bool
    Default
    False
  5. description:

    The GraphQL description of the type.

    Type
    str | None
    Default
    None
  6. directives:

    The directives to attach to the type.

    Type
    Sequence[object] | None
    Default
    ()
  7. extend:

    Whether the type is an extension.

    Type
    bool
    Default
    False