summaryrefslogtreecommitdiff
path: root/src/services/api/graphql/bindings.py
blob: 1fbe13d0c91ddd2d74201be3f33136c4e77269d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import vyos.defaults
from . graphql.mutations import mutation
from . graphql.directives import directives_dict
from ariadne import make_executable_schema, load_schema_from_path, snake_case_fallback_resolvers

def generate_schema():
    api_schema_dir = vyos.defaults.directories['api_schema']

    type_defs = load_schema_from_path(api_schema_dir)

    schema = make_executable_schema(type_defs, mutation, snake_case_fallback_resolvers, directives=directives_dict)

    return schema