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-10-01 03:47:14 +00:00
|
|
|
const AuthenticationResolvers = require('../schemas/resolvers-authentication')
|
2017-08-20 02:51:25 +00:00
|
|
|
const CommentResolvers = require('../schemas/resolvers-comment')
|
2017-08-19 01:21:29 +00:00
|
|
|
const DocumentResolvers = require('../schemas/resolvers-document')
|
2017-09-04 17:03:15 +00:00
|
|
|
const FileResolvers = require('../schemas/resolvers-file')
|
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-20 02:51:25 +00:00
|
|
|
const SettingResolvers = require('../schemas/resolvers-setting')
|
2017-08-14 00:33:06 +00:00
|
|
|
const TagResolvers = require('../schemas/resolvers-tag')
|
2017-09-25 03:22:33 +00:00
|
|
|
const TranslationResolvers = require('../schemas/resolvers-translation')
|
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-10-01 03:47:14 +00:00
|
|
|
AuthenticationResolvers,
|
2017-08-20 02:51:25 +00:00
|
|
|
CommentResolvers,
|
2017-08-19 01:21:29 +00:00
|
|
|
DocumentResolvers,
|
2017-09-04 17:03:15 +00:00
|
|
|
FileResolvers,
|
2017-08-14 00:33:06 +00:00
|
|
|
FolderResolvers,
|
2017-08-09 02:36:29 +00:00
|
|
|
GroupResolvers,
|
2017-08-20 02:51:25 +00:00
|
|
|
SettingResolvers,
|
2017-08-14 00:33:06 +00:00
|
|
|
TagResolvers,
|
2017-09-25 03:22:33 +00:00
|
|
|
TranslationResolvers,
|
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
|