feat(cloudapi-gql): add rebootMachine mutation

This commit is contained in:
Sérgio Ramos 2017-10-04 18:27:26 +01:00 committed by Sérgio Ramos
parent 37c865687b
commit 3135f3b5a7

View File

@ -136,6 +136,23 @@ const resolvers = {
type: ({ type }) => (type ? type.toUpperCase() : type),
// eslint-disable-next-line camelcase
key_id: ({ keyId }) => keyId
},
FirewallRule: {
machines: ({ id }) => api.firewall.listMachines({ id })
},
Snapshot: {
state: ({ state }) => (state ? state.toUpperCase() : state)
},
ImageError: {
code: ({ code }) => (code ? code.toUpperCase() : code)
},
ImageFile: {
compression: ({ compression }) =>
compression ? compression.toUpperCase() : compression
},
Mutation: {
rebootMachine: (root, { id }) =>
api.machines.reboot(id).then(() => resolvers.Query.machine(null, { id }))
}
};