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.

43 lines
1.3 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 AuthenticationResolvers = require('../schemas/resolvers-authentication')
  10. const CommentResolvers = require('../schemas/resolvers-comment')
  11. const DocumentResolvers = require('../schemas/resolvers-document')
  12. const FileResolvers = require('../schemas/resolvers-file')
  13. const FolderResolvers = require('../schemas/resolvers-folder')
  14. const GroupResolvers = require('../schemas/resolvers-group')
  15. const SettingResolvers = require('../schemas/resolvers-setting')
  16. const TagResolvers = require('../schemas/resolvers-tag')
  17. const TranslationResolvers = require('../schemas/resolvers-translation')
  18. const UserResolvers = require('../schemas/resolvers-user')
  19. const resolvers = _.merge(
  20. AuthenticationResolvers,
  21. CommentResolvers,
  22. DocumentResolvers,
  23. FileResolvers,
  24. FolderResolvers,
  25. GroupResolvers,
  26. SettingResolvers,
  27. TagResolvers,
  28. TranslationResolvers,
  29. UserResolvers,
  30. DateScalar
  31. )
  32. const Schema = gqlTools.makeExecutableSchema({
  33. typeDefs,
  34. resolvers
  35. })
  36. module.exports = Schema