mirror of
https://github.com/unraid/api.git
synced 2026-01-09 18:20:12 -06:00
remove welcome subscription and start adding subscriptions for queries
Signed-off-by: Alexis Tyler <xo@wvvw.me>
This commit is contained in:
@@ -61,25 +61,16 @@ module.exports = function (
|
||||
DELETED
|
||||
}
|
||||
|
||||
"""
|
||||
This can only be updated.
|
||||
"""
|
||||
enum UpdateOnlyMutationType {
|
||||
UPDATED
|
||||
}
|
||||
|
||||
type WelcomeSubscription {
|
||||
mutation: MutationType!
|
||||
node: Welcome!
|
||||
}
|
||||
|
||||
type PingSubscription {
|
||||
mutation: MutationType!
|
||||
node: String!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
welcome: WelcomeSubscription!
|
||||
ping: PingSubscription!
|
||||
}
|
||||
`];
|
||||
|
||||
@@ -35,9 +35,6 @@ module.exports = function ($injector, GraphQLJSON, GraphQLLong, GraphQLUUID, pub
|
||||
return pubsub.asyncIterator('ping');
|
||||
}
|
||||
},
|
||||
welcome: {
|
||||
subscribe: () => pubsub.asyncIterator('welcome')
|
||||
},
|
||||
services: {
|
||||
subscribe: () => pubsub.asyncIterator('services')
|
||||
},
|
||||
|
||||
@@ -15,6 +15,15 @@ type Mutation {
|
||||
removeDiskFromArray(input: arrayDiskInput): Array @func(module: "array/add-disk")
|
||||
}
|
||||
|
||||
type ArraySubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Array!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
array: ArraySubscription
|
||||
}
|
||||
|
||||
input arrayDiskInput {
|
||||
"""Disk ID"""
|
||||
id: String!
|
||||
|
||||
@@ -13,6 +13,15 @@ type Mutation {
|
||||
cancelParityCheck: JSON @func(module: "array/update-parity-check", data: { state: "cancel" })
|
||||
}
|
||||
|
||||
type ParityHistorySubscription {
|
||||
mutation: MutationType!
|
||||
node: ParityCheck!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
parityHistory: ParityHistorySubscription
|
||||
}
|
||||
|
||||
type ParityCheck {
|
||||
date: String!
|
||||
duration: Int!
|
||||
|
||||
@@ -1,10 +1,24 @@
|
||||
type Query {
|
||||
"""Docker container"""
|
||||
dockerContainer(id: String!): DockerContainer! @func(module: "docker/get-container")
|
||||
dockerContainer(id: ID!): DockerContainer! @func(module: "docker/get-container")
|
||||
"""All Docker containers"""
|
||||
dockerContainers(all: Boolean): [DockerContainer]! @func(module: "docker/get-containers")
|
||||
}
|
||||
|
||||
type DockerContainerSubscription {
|
||||
mutation: MutationType!
|
||||
node: DockerContainer!
|
||||
}
|
||||
type DockerContainersSubscription {
|
||||
mutation: MutationType!
|
||||
node: [DockerContainer]!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
dockerContainer(id: ID!): DockerContainerSubscription
|
||||
dockerContainers: DockerContainersSubscription
|
||||
}
|
||||
|
||||
enum ContainerPortType {
|
||||
tcp
|
||||
udp
|
||||
|
||||
@@ -5,6 +5,20 @@ type Query {
|
||||
dockerNetworks(all: Boolean): [DockerNetwork]! @func(module: "docker/get-networks")
|
||||
}
|
||||
|
||||
type DockerNetworkSubscription {
|
||||
mutation: MutationType!
|
||||
node: DockerNetwork!
|
||||
}
|
||||
type DockerNetworksSubscription {
|
||||
mutation: MutationType!
|
||||
node: [DockerNetwork]!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
dockerNetwork(id: ID!): DockerNetworkSubscription
|
||||
dockerNetworks: DockerNetworksSubscription
|
||||
}
|
||||
|
||||
type DockerNetwork {
|
||||
name: String
|
||||
id: String
|
||||
|
||||
@@ -3,8 +3,18 @@ type Query {
|
||||
services: [Service] @func(module: "get-services")
|
||||
}
|
||||
|
||||
type ServiceSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Service!
|
||||
}
|
||||
type ServicesSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: [Service]!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
services: [Service]
|
||||
service(id: ID!): ServiceSubscription
|
||||
services: ServicesSubscription
|
||||
}
|
||||
|
||||
type Service {
|
||||
|
||||
@@ -2,6 +2,15 @@ type Query {
|
||||
vars: Vars @func(module: "get-vars")
|
||||
}
|
||||
|
||||
type VarsSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Vars!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
vars(id: ID!): VarsSubscription
|
||||
}
|
||||
|
||||
type Vars {
|
||||
"""Unraid version"""
|
||||
version: String
|
||||
|
||||
Reference in New Issue
Block a user