Showing
1 changed file
with
13 additions
and
0 deletions
back/src/schema.js
0 → 100644
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; |
-
Please register or login to post a comment