mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
606 B
29 lines
606 B
'use strict'
|
|
|
|
/* global wiki */
|
|
|
|
const gqlTools = require('graphql-tools')
|
|
const fs = require('fs')
|
|
const path = require('path')
|
|
|
|
const typeDefs = fs.readFileSync(path.join(wiki.SERVERPATH, 'schemas/types.graphql'), 'utf8')
|
|
|
|
const GroupResolvers = require('../schemas/resolvers-group')
|
|
const UserResolvers = require('../schemas/resolvers-user')
|
|
|
|
const resolvers = {
|
|
Query: {
|
|
groups: GroupResolvers.Query,
|
|
users: UserResolvers.Query
|
|
},
|
|
Group: GroupResolvers.Type,
|
|
User: UserResolvers.Type
|
|
}
|
|
|
|
const Schema = gqlTools.makeExecutableSchema({
|
|
typeDefs,
|
|
resolvers
|
|
})
|
|
|
|
module.exports = Schema
|