sdy

integrate schema management

1 +import path from "path";
2 +import { makeExecutableSchema } from "graphql-tools";
3 +import { fileLoader, mergeResolvers, mergeTypes } from "merge-graphql-schemas";
4 +
5 +const allTypes = fileLoader(path.join(__dirname, "api/**/*.graphql"));
6 +const allResolvers = fileLoader(path.join(__dirname, "api/**/*.js"));
7 +
8 +const schema = makeExecutableSchema({
9 + typeDefs: mergeTypes(allTypes),
10 + resolvers: mergeResolvers(allResolvers),
11 +});
12 +
13 +export default schema;