feat: add unpaired machines endpoint to GraphQL
This commit is contained in:
parent
986df24864
commit
0f93e313b6
3 changed files with 23 additions and 1 deletions
|
|
@ -15,7 +15,8 @@ const resolvers = {
|
|||
},
|
||||
Query: {
|
||||
machines: () => machineLoader.getMachineNames(),
|
||||
machine: (...[, { deviceId }]) => machineLoader.getMachine(deviceId)
|
||||
machine: (...[, { deviceId }]) => machineLoader.getMachine(deviceId),
|
||||
unpairedMachines: () => machineLoader.getUnpairedMachines()
|
||||
},
|
||||
Mutation: {
|
||||
machineAction: (...[, { deviceId, action, cashbox, cassette1, cassette2, cassette3, cassette4, newName }, context]) =>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,15 @@ const typeDef = gql`
|
|||
packetLoss: String
|
||||
}
|
||||
|
||||
type UnpairedMachine {
|
||||
id: ID!
|
||||
deviceId: ID!
|
||||
name: String
|
||||
model: String
|
||||
paired: Date!
|
||||
unpaired: Date!
|
||||
}
|
||||
|
||||
type MachineEvent {
|
||||
id: ID
|
||||
deviceId: String
|
||||
|
|
@ -51,6 +60,7 @@ const typeDef = gql`
|
|||
type Query {
|
||||
machines: [Machine] @auth
|
||||
machine(deviceId: ID!): Machine @auth
|
||||
unpairedMachines: [UnpairedMachine!]! @auth
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue