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.

39 lines
1.0 KiB

  1. const _ = require('lodash')
  2. const graphHelper = require('../../helpers/graph')
  3. /* global WIKI */
  4. module.exports = {
  5. Query: {
  6. async navigation() { return {} }
  7. },
  8. Mutation: {
  9. async navigation() { return {} }
  10. },
  11. NavigationQuery: {
  12. async tree(obj, args, context, info) {
  13. // let renderers = await WIKI.models.renderers.getRenderers()
  14. return []
  15. }
  16. },
  17. NavigationMutation: {
  18. async updateTree(obj, args, context) {
  19. try {
  20. // for (let rdr of args.renderers) {
  21. // await WIKI.models.storage.query().patch({
  22. // isEnabled: rdr.isEnabled,
  23. // config: _.reduce(rdr.config, (result, value, key) => {
  24. // _.set(result, `${value.key}`, value.value)
  25. // return result
  26. // }, {})
  27. // }).where('key', rdr.key)
  28. // }
  29. return {
  30. responseResult: graphHelper.generateSuccess('Navigation updated successfully')
  31. }
  32. } catch (err) {
  33. return graphHelper.generateError(err)
  34. }
  35. }
  36. }
  37. }