Info
Class containing information about the current execution.
This class is passed to resolvers when there’s an argument with type Info
.
Example:
It also supports passing the type of the context and root types:
Constructor:
Signature:
Parameters:
-
_raw_info:
- Type
-
GraphQLResolveInfo
-
_field:
- Type
-
StrawberryField
Methods:
-
get_argument_definition
Get the StrawberryArgument definition for the current field by name.
Signature:
Parameters:
-
name:
- Type
-
str
-
Attributes:
-
field_name:
The name of the current field being resolved.
- Type
-
str
-
schema:
The schema of the current execution.
- Type
-
Schema
-
field_nodes:
- Type
-
List[FieldNode]
-
selected_fields:
The fields that were selected on the current field’s type.
- Type
-
List[Selection]
-
context:
The context passed to the query execution.
- Type
-
ContextType
-
root_value:
The root value passed to the query execution.
- Type
-
RootValueType
-
variable_values:
The variable values passed to the query execution.
- Type
-
Dict[str, Any]
-
return_type:
The return type of the current field being resolved.
- Type
-
Type[WithStrawberryObjectDefinition] | StrawberryType | None
-
python_name:
The name of the current field being resolved in Python format.
- Type
-
str
-
operation:
The operation being executed.
- Type
-
OperationDefinitionNode
-
path:
The path of the current field being resolved.
- Type
-
Path