Strawberry Exceptions
Strawberry defines its library-specific exceptions in strawberry.exceptions
.
Strawberry Schema Exceptions
FieldWithResolverAndDefaultFactoryError
This exception is raised when strawberry.field
is used with both resolver
and default_factory
arguments.
FieldWithResolverAndDefaultValueError
This exception is raised when strawberry.field
is used with both resolver
and default
arguments.
MissingTypesForGenericError
This exception is raised when a Generic
type is added to the Strawberry Schema
without passing any type to make it concrete.
MultipleStrawberryArgumentsError
This exception is raised when strawberry.argument
is used multiple times in a
type annotation.
UnsupportedTypeError
This exception is thrown when the type-annotation used is not supported by
strawberry.field
. At the time of writing this exception is used by Pydantic
only
WrongNumberOfResultsReturned
This exception is raised when the DataLoader returns a different number of results than requested.
Runtime exceptions
Some errors are also thrown when trying to exectuing queries (mutations or subscriptions).
MissingQueryError
This exception is raised when the request
is missing the query
parameter.
UnallowedReturnTypeForUnion
This error is raised when the return type of a Union
is not in the list of
Union types.
WrongReturnTypeForUnion
This exception is thrown when the Union type cannot be resolved because itβs not
a strawberry.field
.