kensho-technologies/graphql-compiler

register_macro_edge builds a schema for macro definitions every time its called

Opened this issue · 0 comments

register_macro_edge calls make_macro_edge_descriptor which calls get_and_validate_macro_edge_info which calls _validate_ast_with_builtin_graphql_validation which calls get_schema_for_macro_edge_definitions which builds the macro edge definition schema. Building the macro edge definition schema involves copying the entire original schema so we probably want to avoid doing this every time we register a macro edge.

We should probably make a MacroRegistry a dataclass and have a post_init method that creates a schema for macro edge definitions once.