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:

  1. name:

    Type
    str
  2. is_input:

    Type
    bool
  3. is_interface:

    Type
    bool
  4. origin:

    Type
    Type[Any]
  5. description:

    Type
    str | None
  6. interfaces:

    Type
    List[StrawberryObjectDefinition]
  7. extend:

    Type
    bool
  8. directives:

    Type
    Sequence[object] | None
  9. is_type_of:

    Type
    Callable[[Any, GraphQLResolveInfo], bool] | None
  10. resolve_type:

    Type
    Callable[[Any, GraphQLResolveInfo, GraphQLAbstractType], str] | None
  11. fields:

    Type
    List[StrawberryField]
  12. concrete_of:

    Type
    StrawberryObjectDefinition | None
    Default
    None
  13. type_var_map:

    Type
    Mapping[str, StrawberryType | type]
    Default
    dict()

Methods:

Attributes:

  1. name:

    Type
    str
  2. is_input:

    Type
    bool
  3. is_interface:

    Type
    bool
  4. origin:

    Type
    Type[Any]
  5. description:

    Type
    str | None
  6. interfaces:

    Type
    List[StrawberryObjectDefinition]
  7. extend:

    Type
    bool
  8. directives:

    Type
    Sequence[object] | None
  9. is_type_of:

    Type
    Callable[[Any, GraphQLResolveInfo], bool] | None
  10. resolve_type:

    Type
    Callable[[Any, GraphQLResolveInfo, GraphQLAbstractType], str] | None
  11. fields:

    Type
    List[StrawberryField]
  12. concrete_of:

    Concrete implementations of Generic TypeDefinitions fill this in

    Type
    StrawberryObjectDefinition | None
  13. type_var_map:

    Type
    Mapping[str, StrawberryType | type]
  14. is_graphql_generic:

    Type
    bool
  15. is_specialized_generic:

    Type
    bool
  16. specialized_type_var_map:

    Type
    Dict[str, type] | None
  17. is_object_type:

    Type
    bool
  18. type_params:

    Type
    List[TypeVar]
  19. is_one_of:

    Type
    bool