recurse
recurse_annotation
def recurse_annotation(node: FieldNode,
parent: str,
type: GraphQLType,
client_schema: GraphQLSchema,
config: GeneratorConfig,
subtree: ast.AST,
registry: ClassRegistry,
is_optional=True) -> ast.AST
Recurse Annotations
Resolves the type of a field and returns the appropriate annotation. If we deal with nested object types it recurses further and generated the objects together with the type_field_node method:
class X(BaseModel): a: int
in this case "a" is generated by type_field_node and "X" is generated by recurse_annotation
Arguments:
nodeFieldNode - The nodetypeGraphQLType - The type of the field as specified in the schemaclient_schemaGraphQLSchema - The schema itselfconfigGeneratorConfig - The generator config (with the defaults)subtreeast.AST - The passed subtreeregistryClassRegistry - A class registry where classes and their imports are registeredparent_namestr, optional - If resolving nested types the name of parent. Defaults to "".is_optionalbool, optional - A recurse modifier for optional types. Defaults to True.
Raises:
NotImplementedError- Not implemneted errorsNotImplementedError- description
Returns:
ast.AST- The returned tree
type_field_node
def type_field_node(node: FieldNode,
parent: str,
field: GraphQLField,
client_schema: GraphQLSchema,
config: GeneratorConfig,
subtree: ast.AST,
registry: ClassRegistry,
is_optional=True)
Types a field node
This
Arguments:
nodeFieldNode - descriptionfieldGraphQLField - descriptionclient_schemaGraphQLSchema - descriptionconfigGeneratorConfig - descriptionsubtreeast.AST - descriptionregistryClassRegistry - descriptionparent_namestr, optional - description. Defaults to "".is_optionalbool, optional - description. Defaults to True.
Returns:
_type_- description