summaryrefslogtreecommitdiff
path: root/src/services/api/graphql/utils/schema_from_config_session.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/api/graphql/utils/schema_from_config_session.py')
-rwxr-xr-xsrc/services/api/graphql/utils/schema_from_config_session.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/services/api/graphql/utils/schema_from_config_session.py b/src/services/api/graphql/utils/schema_from_config_session.py
index ea78aaf88..b6609357e 100755
--- a/src/services/api/graphql/utils/schema_from_config_session.py
+++ b/src/services/api/graphql/utils/schema_from_config_session.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 config_session_function import queries, mutations
else:
from . util import snake_to_pascal_case, map_type_name
+ from . config_session_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_config_session_definitions():
- from config_session_function import queries, mutations
-
results = []
for name,func in queries.items():
res = create_schema(name, func, query_template)