summaryrefslogtreecommitdiff
path: root/src/services/api/graphql/utils/schema_from_composite.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/api/graphql/utils/schema_from_composite.py')
-rwxr-xr-xsrc/services/api/graphql/utils/schema_from_composite.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/services/api/graphql/utils/schema_from_composite.py b/src/services/api/graphql/utils/schema_from_composite.py
index f9983cd98..d5e0ecdf6 100755
--- a/src/services/api/graphql/utils/schema_from_composite.py
+++ b/src/services/api/graphql/utils/schema_from_composite.py
@@ -23,13 +23,15 @@ import json
from inspect import signature, getmembers, isfunction, isclass, getmro
from jinja2 import Template
+from vyos.defaults import directories
if __package__ is None or __package__ == '':
from util import snake_to_pascal_case, map_type_name
+ from composite_function import queries, mutations
else:
from . util import snake_to_pascal_case, map_type_name
+ from . composite_function import queries, mutations
-# this will be run locally before the build
-SCHEMA_PATH = '../graphql/schema'
+SCHEMA_PATH = directories['api_schema']
schema_data: dict = {'schema_name': '',
'schema_fields': []}
@@ -100,8 +102,6 @@ def create_schema(func_name: str, func: callable, template: str) -> str:
return res
def generate_composite_definitions():
- from composite_function import queries, mutations
-
results = []
for name,func in queries.items():
res = create_schema(name, func, query_template)