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:
-
name:The GraphQL name of the type.
- Type
-
str
-
fields:The fields of the type.
- Type
-
List[StrawberryField]
-
is_input:Whether the type is an input type.
- Type
-
bool - Default
-
False
-
is_interface:Whether the type is an interface.
- Type
-
bool - Default
-
False
-
description:The GraphQL description of the type.
- Type
-
str | None - Default
-
None
-
directives:The directives to attach to the type.
- Type
-
Sequence[object] | None - Default
-
()
-
extend:Whether the type is an extension.
- Type
-
bool - Default
-
False