3434 RelationshipSchemaAPI ,
3535 SchemaRoot ,
3636 SchemaRootAPI ,
37+ TemplateSchemaAPI ,
3738)
3839
3940if TYPE_CHECKING :
5859 "RelationshipSchemaAPI" ,
5960 "SchemaRoot" ,
6061 "SchemaRootAPI" ,
62+ "TemplateSchemaAPI" ,
6163]
6264
6365
@@ -78,8 +80,10 @@ class EnumMutation(str, Enum):
7880
7981
8082MainSchemaTypes : TypeAlias = Union [NodeSchema , GenericSchema ]
81- MainSchemaTypesAPI : TypeAlias = Union [NodeSchemaAPI , GenericSchemaAPI , ProfileSchemaAPI ]
82- MainSchemaTypesAll : TypeAlias = Union [NodeSchema , GenericSchema , NodeSchemaAPI , GenericSchemaAPI , ProfileSchemaAPI ]
83+ MainSchemaTypesAPI : TypeAlias = Union [NodeSchemaAPI , GenericSchemaAPI , ProfileSchemaAPI , TemplateSchemaAPI ]
84+ MainSchemaTypesAll : TypeAlias = Union [
85+ NodeSchema , GenericSchema , NodeSchemaAPI , GenericSchemaAPI , ProfileSchemaAPI , TemplateSchemaAPI
86+ ]
8387
8488
8589class InfrahubSchemaBase :
@@ -417,6 +421,10 @@ async def fetch(
417421 profile = ProfileSchemaAPI (** profile_schema )
418422 nodes [profile .kind ] = profile
419423
424+ for template_schema in data .get ("templates" , []):
425+ template = TemplateSchemaAPI (** template_schema )
426+ nodes [template .kind ] = template
427+
420428 return nodes
421429
422430
@@ -621,6 +629,10 @@ def fetch(
621629 profile = ProfileSchemaAPI (** profile_schema )
622630 nodes [profile .kind ] = profile
623631
632+ for template_schema in data .get ("templates" , []):
633+ template = TemplateSchemaAPI (** template_schema )
634+ nodes [template .kind ] = template
635+
624636 return nodes
625637
626638 def load (
0 commit comments