StrawberryAnnotation
Constructor:
Signature:
def __init__( self, annotation: object | str, namespace: Dict[str, Any] | None = None,) -> None: ...
Parameters:
-
annotation:
- Type
-
object | str
-
namespace:
- Type
-
Dict[str, Any] | None
- Default
-
None
Methods:
-
from_annotation
Signature:
def from_annotation(annotation: object, namespace: Dict[str, Any] | None = None) -> StrawberryAnnotation | None:...Parameters:
-
annotation:
- Type
-
object
-
namespace:
- Type
-
Dict[str, Any] | None
- Default
-
None
-
-
evaluate
Return evaluated annotation using
strawberry.util.typing.eval_type
.Signature:
def evaluate(self) -> type:... -
resolve
Return resolved (transformed) annotation.
Signature:
def resolve(self) -> StrawberryType | type:... -
set_namespace_from_field
Signature:
def set_namespace_from_field(self, field: StrawberryField) -> None:...Parameters:
-
field:
- Type
-
StrawberryField
-
-
create_concrete_type
Signature:
def create_concrete_type(self, evaled_type: type) -> type:...Parameters:
-
evaled_type:
- Type
-
type
-
-
create_enum
Signature:
def create_enum(self, evaled_type: Any) -> EnumDefinition:...Parameters:
-
evaled_type:
- Type
-
Any
-
-
create_list
Signature:
def create_list(self, evaled_type: Any) -> StrawberryList:...Parameters:
-
evaled_type:
- Type
-
Any
-
-
create_optional
Signature:
def create_optional(self, evaled_type: Any) -> StrawberryOptional:...Parameters:
-
evaled_type:
- Type
-
Any
-
-
create_type_var
Signature:
def create_type_var(self, evaled_type: TypeVar) -> StrawberryTypeVar:...Parameters:
-
evaled_type:
- Type
-
TypeVar
-
-
create_union
Signature:
def create_union(self, evaled_type: Type[Any], args: list[Any]) -> StrawberryUnion:...Parameters:
-
evaled_type:
- Type
-
Type[Any]
-
args:
- Type
-
list[Any]
-
Attributes:
-
raw_annotation:
-
namespace:
-
annotation:
Return evaluated type on success or fallback to raw (string) annotation.
- Type
-
object | str