fix: setup issues + webpack improvements

This commit is contained in:
Nicolas Giard
2018-09-29 15:39:09 -04:00
parent edd0c1a00a
commit ed7d3ab540
26 changed files with 2267 additions and 1295 deletions

View File

@@ -0,0 +1,39 @@
const _ = require('lodash')
const graphHelper = require('../../helpers/graph')
/* global WIKI */
module.exports = {
Query: {
async navigation() { return {} }
},
Mutation: {
async navigation() { return {} }
},
NavigationQuery: {
async tree(obj, args, context, info) {
// let renderers = await WIKI.models.renderers.getRenderers()
return []
}
},
NavigationMutation: {
async updateTree(obj, args, context) {
try {
// for (let rdr of args.renderers) {
// await WIKI.models.storage.query().patch({
// isEnabled: rdr.isEnabled,
// config: _.reduce(rdr.config, (result, value, key) => {
// _.set(result, `${value.key}`, value.value)
// return result
// }, {})
// }).where('key', rdr.key)
// }
return {
responseResult: graphHelper.generateSuccess('Navigation updated successfully')
}
} catch (err) {
return graphHelper.generateError(err)
}
}
}
}

View File

@@ -0,0 +1,51 @@
# ===============================================
# NAVIGATION
# ===============================================
extend type Query {
navigation: NavigationQuery
}
extend type Mutation {
navigation: NavigationMutation
}
# -----------------------------------------------
# QUERIES
# -----------------------------------------------
type NavigationQuery {
tree: [NavigationItem]!
}
# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------
type NavigationMutation {
updateTree(
tree: [NavigationItemInput]!
): DefaultResponse
}
# -----------------------------------------------
# TYPES
# -----------------------------------------------
type NavigationItem {
id: String!
kind: String!
label: String
icon: String
targetType: String
target: String
}
input NavigationItemInput {
id: String!
kind: String!
label: String
icon: String
targetType: String
target: String
}