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
521 B

  1. /* global WIKI */
  2. const _ = require('lodash')
  3. module.exports = {
  4. Query: {
  5. settings(obj, args, context, info) {
  6. return WIKI.models.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.models.Setting.update({
  17. value: args.value
  18. }, { where: { key: args.key } })
  19. }
  20. }
  21. }