refactor: schema modularization
This commit is contained in:
parent
d9e3a9e61f
commit
82b5db6908
35 changed files with 2423 additions and 685 deletions
19
lib/new-admin/graphql/resolvers/log.resolver.js
Normal file
19
lib/new-admin/graphql/resolvers/log.resolver.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const { parseAsync } = require('json2csv')
|
||||
|
||||
const logs = require('../../../logs')
|
||||
const serverLogs = require('../../modules/server-logs')
|
||||
|
||||
const resolvers = {
|
||||
Query: {
|
||||
machineLogs: (...[, { deviceId, from, until, limit, offset }]) =>
|
||||
logs.simpleGetMachineLogs(deviceId, from, until, limit, offset),
|
||||
machineLogsCsv: (...[, { deviceId, from, until, limit, offset }]) =>
|
||||
logs.simpleGetMachineLogs(deviceId, from, until, limit, offset).then(parseAsync),
|
||||
serverLogs: (...[, { from, until, limit, offset }]) =>
|
||||
serverLogs.getServerLogs(from, until, limit, offset),
|
||||
serverLogsCsv: (...[, { from, until, limit, offset }]) =>
|
||||
serverLogs.getServerLogs(from, until, limit, offset).then(parseAsync)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = resolvers
|
||||
Loading…
Add table
Add a link
Reference in a new issue