diff --git a/backend/infrahub/core/initialization.py b/backend/infrahub/core/initialization.py index ae6989a849..9d53d510a5 100644 --- a/backend/infrahub/core/initialization.py +++ b/backend/infrahub/core/initialization.py @@ -28,6 +28,7 @@ from infrahub.core.schema.manager import SchemaManager from infrahub.database import InfrahubDatabase from infrahub.exceptions import DatabaseError +from infrahub.graphql.manager import GraphQLSchemaManager from infrahub.log import get_logger from infrahub.menu.menu import default_menu from infrahub.menu.utils import create_menu_children @@ -178,6 +179,16 @@ async def initialization(db: InfrahubDatabase) -> None: ) await branch.save(db=db) + default_branch = registry.get_branch_from_registry(branch=registry.default_branch) + schema_branch = registry.schema.get_schema_branch(name=default_branch.name) + gqlm = GraphQLSchemaManager.get_manager_for_branch(branch=default_branch, schema_branch=schema_branch) + gqlm.get_graphql_schema( + include_query=True, + include_mutation=True, + include_subscription=True, + include_types=True, + ) + # --------------------------------------------------- # Load Default Namespace # ---------------------------------------------------