2017-07-25 02:37:13 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
/* global wiki */
|
|
|
|
|
2017-08-07 01:05:10 +00:00
|
|
|
const gqlTools = require('graphql-tools')
|
|
|
|
const fs = require('fs')
|
|
|
|
const path = require('path')
|
2017-08-09 02:36:29 +00:00
|
|
|
const _ = require('lodash')
|
2017-07-25 02:37:13 +00:00
|
|
|
|
2017-08-07 01:05:10 +00:00
|
|
|
const typeDefs = fs.readFileSync(path.join(wiki.SERVERPATH, 'schemas/types.graphql'), 'utf8')
|
2017-07-25 02:37:13 +00:00
|
|
|
|
2017-08-13 18:39:07 +00:00
|
|
|
const DateScalar = require('../schemas/scalar-date')
|
2017-08-14 00:33:06 +00:00
|
|
|
const FolderResolvers = require('../schemas/resolvers-folder')
|
2017-08-07 01:05:10 +00:00
|
|
|
const GroupResolvers = require('../schemas/resolvers-group')
|
2017-08-14 00:33:06 +00:00
|
|
|
const TagResolvers = require('../schemas/resolvers-tag')
|
2017-08-07 01:05:10 +00:00
|
|
|
const UserResolvers = require('../schemas/resolvers-user')
|
|
|
|
|
2017-08-09 02:36:29 +00:00
|
|
|
const resolvers = _.merge(
|
2017-08-14 00:33:06 +00:00
|
|
|
FolderResolvers,
|
2017-08-09 02:36:29 +00:00
|
|
|
GroupResolvers,
|
2017-08-14 00:33:06 +00:00
|
|
|
TagResolvers,
|
2017-08-13 18:39:07 +00:00
|
|
|
UserResolvers,
|
|
|
|
DateScalar
|
2017-08-09 02:36:29 +00:00
|
|
|
)
|
2017-07-25 02:37:13 +00:00
|
|
|
|
2017-08-07 01:05:10 +00:00
|
|
|
const Schema = gqlTools.makeExecutableSchema({
|
|
|
|
typeDefs,
|
|
|
|
resolvers
|
2017-07-25 02:37:13 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
module.exports = Schema
|