import os

from ariadne import make_executable_schema, load_schema_from_path

from api_graphql.definition import QUERIES
from api_graphql.mutation import Mutation
from api_graphql.query import Query
from api_graphql.subscription import Subscription

type_defs = load_schema_from_path(
    os.path.join(os.path.dirname(os.path.realpath(__file__)), "../graphql/")
)
schema = make_executable_schema(
    type_defs,
    Query(),
    Mutation(),
    Subscription(),
    *QUERIES,
)
