strawberry.mutation
Annotates a method or property as a GraphQL mutation.
Returns:
The field object.
Signature:
Parameters:
-
resolver:
The resolver for the field. It can be a sync or async function.
- Type
-
_RESOLVER_TYPE[Any] | None
- Default
-
None
-
name:
The GraphQL name of the field.
- Type
-
str | None
- Default
-
None
-
description:
The GraphQL description of the field.
- Type
-
str | None
- Default
-
None
-
permission_classes:
The permission classes required to access the field.
- Type
-
List[Type[BasePermission]] | None
- Default
-
None
-
deprecation_reason:
The deprecation reason for the field.
- Type
-
str | None
- Default
-
None
-
default:
The default value for the field.
- Type
-
Any
- Default
-
dataclasses.MISSING
-
default_factory:
The default factory for the field.
- Type
-
Callable[..., object] | object
- Default
-
dataclasses.MISSING
-
metadata:
The metadata for the field.
- Type
-
Mapping[Any, Any] | None
- Default
-
None
-
directives:
The directives for the field.
- Type
-
Sequence[object] | None
- Default
-
()
-
extensions:
The extensions for the field.
- Type
-
List[FieldExtension] | None
- Default
-
None
-
graphql_type:
The GraphQL type for the field, useful when you want to use a different type in the resolver than the one in the schema.
- Type
-
Any | None
- Default
-
None
-
init:
This parameter is used by PyRight to determine whether this field is added in the constructor or not. It is not used to change any behavior at the moment.
- Type
-
Literal[True, False, None]
- Default
-
None