mirror of
https://github.com/unraid/api.git
synced 2026-05-12 18:50:26 -05:00
refactor: drop node/mutation for subcriptions
This commit is contained in:
+3
-28
@@ -52,35 +52,10 @@ const baseTypes = [gql`
|
||||
reboot: String
|
||||
}
|
||||
|
||||
enum MutationType {
|
||||
CREATED
|
||||
UPDATED
|
||||
DELETED
|
||||
}
|
||||
|
||||
enum UpdateOnlyMutationType {
|
||||
UPDATED
|
||||
}
|
||||
|
||||
type PingSubscription {
|
||||
mutation: MutationType!
|
||||
node: String!
|
||||
}
|
||||
|
||||
type InfoSubscription {
|
||||
mutation: MutationType!
|
||||
node: Info!
|
||||
}
|
||||
|
||||
type PluginModuleSubscription {
|
||||
mutation: MutationType!
|
||||
node: JSON!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
ping: PingSubscription!
|
||||
info: InfoSubscription!
|
||||
pluginModule(plugin: String!, module: String!, params: JSON, result: String): PluginModuleSubscription!
|
||||
ping: String!
|
||||
info: Info!
|
||||
pluginModule(plugin: String!, module: String!, params: JSON, result: String): JSON!
|
||||
online: Boolean!
|
||||
}
|
||||
`];
|
||||
|
||||
@@ -29,13 +29,8 @@ type Mutation {
|
||||
updateApikey(name: String!, input: updateApikeyInput): ApiKey @func(module: "updateApikey")
|
||||
}
|
||||
|
||||
type ApikeysSubscription {
|
||||
mutation: MutationType!
|
||||
node: ApiKey
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
apikeys: ApikeysSubscription
|
||||
apikeys: [ApiKey]
|
||||
}
|
||||
|
||||
type ApiKey {
|
||||
|
||||
@@ -20,13 +20,8 @@ type Mutation {
|
||||
clearArrayDiskStatistics(id: ID!): JSON
|
||||
}
|
||||
|
||||
type ArraySubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Array!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
array: ArraySubscription
|
||||
array: Array!
|
||||
}
|
||||
|
||||
input arrayDiskInput {
|
||||
|
||||
@@ -13,13 +13,8 @@ type Mutation {
|
||||
cancelParityCheck: JSON @func(module: "updateParityCheck", data: { state: "cancel" })
|
||||
}
|
||||
|
||||
type ParityHistorySubscription {
|
||||
mutation: MutationType!
|
||||
node: ParityCheck!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
parityHistory: ParityHistorySubscription
|
||||
parityHistory: ParityCheck!
|
||||
}
|
||||
|
||||
type ParityCheck {
|
||||
|
||||
@@ -12,12 +12,7 @@ type Device {
|
||||
sectorSize: String
|
||||
}
|
||||
|
||||
type DevicesSubscription {
|
||||
mutation: MutationType!
|
||||
node: [Device!]
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
devices: DevicesSubscription!
|
||||
device(id: ID!): DevicesSubscription!
|
||||
devices: [Device!]
|
||||
device(id: ID!): Device!
|
||||
}
|
||||
|
||||
@@ -5,18 +5,9 @@ type Query {
|
||||
dockerContainers(all: Boolean): [DockerContainer]! @func(module: "getDockerContainers")
|
||||
}
|
||||
|
||||
type DockerContainerSubscription {
|
||||
mutation: MutationType!
|
||||
node: DockerContainer!
|
||||
}
|
||||
type DockerContainersSubscription {
|
||||
mutation: MutationType!
|
||||
node: [DockerContainer]!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
dockerContainer(id: ID!): DockerContainerSubscription
|
||||
dockerContainers: DockerContainersSubscription
|
||||
dockerContainer(id: ID!): DockerContainer!
|
||||
dockerContainers: [DockerContainer]
|
||||
}
|
||||
|
||||
enum ContainerPortType {
|
||||
|
||||
@@ -5,18 +5,9 @@ type Query {
|
||||
dockerNetworks(all: Boolean): [DockerNetwork]! @func(module: "getDockerNetworks")
|
||||
}
|
||||
|
||||
type DockerNetworkSubscription {
|
||||
mutation: MutationType!
|
||||
node: DockerNetwork!
|
||||
}
|
||||
type DockerNetworksSubscription {
|
||||
mutation: MutationType!
|
||||
node: [DockerNetwork]!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
dockerNetwork(id: ID!): DockerNetworkSubscription
|
||||
dockerNetworks: DockerNetworksSubscription
|
||||
dockerNetwork(id: ID!): DockerNetwork!
|
||||
dockerNetworks: [DockerNetwork]!
|
||||
}
|
||||
|
||||
type DockerNetwork {
|
||||
|
||||
@@ -3,18 +3,9 @@ type Query {
|
||||
servers: [Server]
|
||||
}
|
||||
|
||||
type ServerSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Server!
|
||||
}
|
||||
type ServersSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: [Server!]
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
server(name: String!): ServerSubscription
|
||||
servers: ServersSubscription
|
||||
server(name: String!): Server!
|
||||
servers: [Server!]
|
||||
}
|
||||
|
||||
enum Status {
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
type Query {
|
||||
# @todo finish this
|
||||
service(name: String!): Service @func(module: "services/name/get-service")
|
||||
services: [Service] @func(module: "getServices")
|
||||
}
|
||||
|
||||
type ServiceSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Service!
|
||||
}
|
||||
type ServicesSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: [Service!]
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
service(name: String!): ServiceSubscription
|
||||
services: ServicesSubscription
|
||||
service(name: String!): [Service!]
|
||||
services: [Service!]
|
||||
}
|
||||
|
||||
type Service {
|
||||
|
||||
@@ -3,18 +3,9 @@ type Query {
|
||||
shares: [Share] @func(module: "getShares")
|
||||
}
|
||||
|
||||
type ShareSubscription {
|
||||
mutation: MutationType!
|
||||
node: Share!
|
||||
}
|
||||
type SharesSubscription {
|
||||
mutation: MutationType!
|
||||
node: [Share!]
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
share(id: ID!): ShareSubscription
|
||||
shares: SharesSubscription
|
||||
share(id: ID!): Share!
|
||||
shares: [Share!]
|
||||
}
|
||||
|
||||
"""Network Share"""
|
||||
|
||||
@@ -2,13 +2,8 @@ type Query {
|
||||
unassignedDevices: [UnassignedDevice] @func(module: "getUnassignedDevices")
|
||||
}
|
||||
|
||||
type UnassignedDevicesSubscription {
|
||||
mutation: MutationType!
|
||||
node: [UnassignedDevice!]
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
unassignedDevices: UnassignedDevicesSubscription
|
||||
unassignedDevices: [UnassignedDevice!]
|
||||
}
|
||||
|
||||
type UnassignedDevice {
|
||||
|
||||
@@ -3,9 +3,6 @@ type Query {
|
||||
me: Me @func(module: "getMe")
|
||||
}
|
||||
|
||||
# type Mutation {
|
||||
# }
|
||||
|
||||
"""The current user"""
|
||||
type Me implements UserAccount {
|
||||
id: ID!
|
||||
@@ -15,11 +12,6 @@ type Me implements UserAccount {
|
||||
permissions: JSON
|
||||
}
|
||||
|
||||
type MeSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Me
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
me: MeSubscription
|
||||
me: Me
|
||||
}
|
||||
@@ -33,18 +33,9 @@ type Mutation {
|
||||
deleteUser(input: deleteUserInput!): User @func(module: "deleteUser")
|
||||
}
|
||||
|
||||
type UserSubscription {
|
||||
mutation: MutationType!
|
||||
node: User!
|
||||
}
|
||||
type UsersSubscription {
|
||||
mutation: MutationType!
|
||||
node: [User]!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
user(id: ID!): UserSubscription
|
||||
users: UsersSubscription
|
||||
user(id: ID!): User!
|
||||
users: [User]!
|
||||
}
|
||||
|
||||
"""A local user account"""
|
||||
|
||||
@@ -2,13 +2,8 @@ type Query {
|
||||
vars: Vars @func(module: "getVars")
|
||||
}
|
||||
|
||||
type VarsSubscription {
|
||||
mutation: UpdateOnlyMutationType!
|
||||
node: Vars!
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
vars(id: ID!): VarsSubscription
|
||||
vars(id: ID!): Vars!
|
||||
}
|
||||
|
||||
type Vars {
|
||||
|
||||
@@ -9,13 +9,8 @@ type Vms {
|
||||
domains: [VmDomain!] @func(module: "getDomains")
|
||||
}
|
||||
|
||||
type VmDomainSubscription {
|
||||
mutation: MutationType!
|
||||
node: [VmDomain!]
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
vms: VmDomainSubscription!
|
||||
vms: [VmDomain!]
|
||||
}
|
||||
|
||||
enum VmState {
|
||||
|
||||
@@ -10,11 +10,6 @@ type VmNetwork {
|
||||
_placeholderType: String
|
||||
}
|
||||
|
||||
type VmNetworksSubscription {
|
||||
mutation: MutationType!
|
||||
node: [VmNetwork!]
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
vmNetworks: VmNetworksSubscription!
|
||||
vmNetworks: [VmNetwork!]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user