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.

41 lines
1.2 KiB

  1. 'use strict'
  2. /* global wiki */
  3. const gqlTools = require('graphql-tools')
  4. const fs = require('fs')
  5. const path = require('path')
  6. const _ = require('lodash')
  7. const typeDefs = fs.readFileSync(path.join(wiki.SERVERPATH, 'schemas/types.graphql'), 'utf8')
  8. const DateScalar = require('../schemas/scalar-date')
  9. const CommentResolvers = require('../schemas/resolvers-comment')
  10. const DocumentResolvers = require('../schemas/resolvers-document')
  11. const FileResolvers = require('../schemas/resolvers-file')
  12. const FolderResolvers = require('../schemas/resolvers-folder')
  13. const GroupResolvers = require('../schemas/resolvers-group')
  14. const SettingResolvers = require('../schemas/resolvers-setting')
  15. const TagResolvers = require('../schemas/resolvers-tag')
  16. const TranslationResolvers = require('../schemas/resolvers-translation')
  17. const UserResolvers = require('../schemas/resolvers-user')
  18. const resolvers = _.merge(
  19. CommentResolvers,
  20. DocumentResolvers,
  21. FileResolvers,
  22. FolderResolvers,
  23. GroupResolvers,
  24. SettingResolvers,
  25. TagResolvers,
  26. TranslationResolvers,
  27. UserResolvers,
  28. DateScalar
  29. )
  30. const Schema = gqlTools.makeExecutableSchema({
  31. typeDefs,
  32. resolvers
  33. })
  34. module.exports = Schema