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 node
- typeGraphQLType - The type of the field as specified in the schema
- client_schemaGraphQLSchema - The schema itself
- configGeneratorConfig - The generator config (with the defaults)
- subtreeast.AST - The passed subtree
- registryClassRegistry - A class registry where classes and their imports are registered
- parent_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 errors
- NotImplementedError- 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 - description
- fieldGraphQLField - description
- client_schemaGraphQLSchema - description
- configGeneratorConfig - description
- subtreeast.AST - description
- registryClassRegistry - description
- parent_namestr, optional - description. Defaults to "".
- is_optionalbool, optional - description. Defaults to True.
Returns:
- _type_- description