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.

24 lines
513 B

  1. /* global wiki */
  2. const _ = require('lodash')
  3. module.exports = {
  4. Query: {
  5. settings(obj, args, context, info) {
  6. return wiki.db.Setting.findAll({ where: args, raw: true }).then(entries => {
  7. return _.map(entries, entry => {
  8. entry.config = JSON.stringify(entry.config)
  9. return entry
  10. })
  11. })
  12. }
  13. },
  14. Mutation: {
  15. setConfigEntry(obj, args) {
  16. return wiki.db.Setting.update({
  17. value: args.value
  18. }, { where: { key: args.key } })
  19. }
  20. }
  21. }