also wildcard include resolvers

This commit is contained in:
Ulf Gebhardt 2019-05-31 16:04:17 +02:00
parent 4c758a9083
commit 754decd308
No known key found for this signature in database
GPG Key ID: 44C888923CC8E7F3
2 changed files with 8 additions and 40 deletions

View File

@ -1,40 +1,2 @@
// resolvers
import userManagement from './resolvers/user_management.js'
import statistics from './resolvers/statistics.js'
import reports from './resolvers/reports.js'
import posts from './resolvers/posts.js'
import moderation from './resolvers/moderation.js'
import follow from './resolvers/follow.js'
import shout from './resolvers/shout.js'
import rewards from './resolvers/rewards.js'
import socialMedia from './resolvers/socialMedia.js'
import notifications from './resolvers/notifications'
import comments from './resolvers/comments'
import users from './resolvers/users'
// types
import types from './types'
export const typeDefs = types
export const resolvers = {
Query: {
...statistics.Query,
...userManagement.Query,
...notifications.Query,
...comments.Query,
},
Mutation: {
...userManagement.Mutation,
...reports.Mutation,
...posts.Mutation,
...moderation.Mutation,
...follow.Mutation,
...shout.Mutation,
...rewards.Mutation,
...socialMedia.Mutation,
...notifications.Mutation,
...comments.Mutation,
...users.Mutation,
},
}
export { default as typeDefs } from './types'
export { default as resolvers } from './resolvers'

View File

@ -0,0 +1,6 @@
import path from 'path'
import { fileLoader, mergeResolvers } from 'merge-graphql-schemas'
const resolversArray = fileLoader(path.join(__dirname, './'), { extensions: ['!(*.spec).js'] })
export default mergeResolvers(resolversArray)