strawberry.types.object_type.StrawberryObjectDefinition
Encapsulates definitions for Input / Object / interface GraphQL Types.
In order get the definition from a decorated object you can use
has_object_definition
or get_object_definition
as a shortcut.
Constructor:
Signature:
def __init__( self, name: str, is_input: bool, is_interface: bool, origin: Type[Any], description: str | None, interfaces: List[StrawberryObjectDefinition], extend: bool, directives: Sequence[object] | None, is_type_of: Callable[[Any, GraphQLResolveInfo], bool] | None, resolve_type: Callable[[Any, GraphQLResolveInfo, GraphQLAbstractType], str] | None, fields: List[StrawberryField], concrete_of: StrawberryObjectDefinition | None = None, type_var_map: Mapping[str, StrawberryType | type] = dict(),) -> None: ...
Parameters:
-
name:
- Type
-
str
-
is_input:
- Type
-
bool
-
is_interface:
- Type
-
bool
-
origin:
- Type
-
Type[Any]
-
description:
- Type
-
str | None
-
interfaces:
- Type
-
List[StrawberryObjectDefinition]
-
extend:
- Type
-
bool
-
directives:
- Type
-
Sequence[object] | None
-
is_type_of:
- Type
-
Callable[[Any, GraphQLResolveInfo], bool] | None
-
resolve_type:
- Type
-
Callable[[Any, GraphQLResolveInfo, GraphQLAbstractType], str] | None
-
fields:
- Type
-
List[StrawberryField]
-
concrete_of:
- Type
-
StrawberryObjectDefinition | None
- Default
-
None
-
type_var_map:
- Type
-
Mapping[str, StrawberryType | type]
- Default
-
dict()
Methods:
-
resolve_generic
Signature:
def resolve_generic(self, wrapped_cls: type) -> type:...Parameters:
-
wrapped_cls:
- Type
-
type
-
-
copy_with
Signature:
def copy_with(self, type_var_map: Mapping[str, StrawberryType | type]) -> Type[WithStrawberryObjectDefinition]:...Parameters:
-
type_var_map:
- Type
-
Mapping[str, StrawberryType | type]
-
-
get_field
Signature:
def get_field(self, python_name: str) -> StrawberryField | None:...Parameters:
-
python_name:
- Type
-
str
-
-
is_implemented_by
Signature:
def is_implemented_by(self, root: Type[WithStrawberryObjectDefinition]) -> bool:...Parameters:
-
root:
- Type
-
Type[WithStrawberryObjectDefinition]
-
Attributes:
-
name:
- Type
-
str
-
is_input:
- Type
-
bool
-
is_interface:
- Type
-
bool
-
origin:
- Type
-
Type[Any]
-
description:
- Type
-
str | None
-
interfaces:
- Type
-
List[StrawberryObjectDefinition]
-
extend:
- Type
-
bool
-
directives:
- Type
-
Sequence[object] | None
-
is_type_of:
- Type
-
Callable[[Any, GraphQLResolveInfo], bool] | None
-
resolve_type:
- Type
-
Callable[[Any, GraphQLResolveInfo, GraphQLAbstractType], str] | None
-
fields:
- Type
-
List[StrawberryField]
-
concrete_of:
Concrete implementations of Generic TypeDefinitions fill this in
- Type
-
StrawberryObjectDefinition | None
-
type_var_map:
- Type
-
Mapping[str, StrawberryType | type]
-
is_graphql_generic:
- Type
-
bool
-
is_specialized_generic:
- Type
-
bool
-
specialized_type_var_map:
- Type
-
Dict[str, type] | None
-
is_object_type:
- Type
-
bool
-
type_params:
- Type
-
List[TypeVar]
-
is_one_of:
- Type
-
bool