diff --git a/app/graphql/index.ts b/app/graphql/index.ts index 41547e336..a15cabcad 100644 --- a/app/graphql/index.ts +++ b/app/graphql/index.ts @@ -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! } `]; diff --git a/app/graphql/schema/types/apikeys/apikey.graphql b/app/graphql/schema/types/apikeys/apikey.graphql index 6803b22d0..56fb7deb8 100644 --- a/app/graphql/schema/types/apikeys/apikey.graphql +++ b/app/graphql/schema/types/apikeys/apikey.graphql @@ -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 { diff --git a/app/graphql/schema/types/array/array.graphql b/app/graphql/schema/types/array/array.graphql index f5af2d7ee..96086e94f 100644 --- a/app/graphql/schema/types/array/array.graphql +++ b/app/graphql/schema/types/array/array.graphql @@ -20,13 +20,8 @@ type Mutation { clearArrayDiskStatistics(id: ID!): JSON } -type ArraySubscription { - mutation: UpdateOnlyMutationType! - node: Array! -} - type Subscription { - array: ArraySubscription + array: Array! } input arrayDiskInput { diff --git a/app/graphql/schema/types/array/parity.graphql b/app/graphql/schema/types/array/parity.graphql index c0497a966..dacaac800 100644 --- a/app/graphql/schema/types/array/parity.graphql +++ b/app/graphql/schema/types/array/parity.graphql @@ -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 { diff --git a/app/graphql/schema/types/devices/device.graphql b/app/graphql/schema/types/devices/device.graphql index fe254c266..35d3fb009 100644 --- a/app/graphql/schema/types/devices/device.graphql +++ b/app/graphql/schema/types/devices/device.graphql @@ -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! } diff --git a/app/graphql/schema/types/docker/container.graphql b/app/graphql/schema/types/docker/container.graphql index 5cb962d7d..68e2771bf 100644 --- a/app/graphql/schema/types/docker/container.graphql +++ b/app/graphql/schema/types/docker/container.graphql @@ -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 { diff --git a/app/graphql/schema/types/docker/network.graphql b/app/graphql/schema/types/docker/network.graphql index 5bee2ce48..aee1893d3 100644 --- a/app/graphql/schema/types/docker/network.graphql +++ b/app/graphql/schema/types/docker/network.graphql @@ -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 { diff --git a/app/graphql/schema/types/servers/server.graphql b/app/graphql/schema/types/servers/server.graphql index 7a08bad52..1ac25df65 100644 --- a/app/graphql/schema/types/servers/server.graphql +++ b/app/graphql/schema/types/servers/server.graphql @@ -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 { diff --git a/app/graphql/schema/types/services/service.graphql b/app/graphql/schema/types/services/service.graphql index 9e9d8d1f8..3928011a8 100644 --- a/app/graphql/schema/types/services/service.graphql +++ b/app/graphql/schema/types/services/service.graphql @@ -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 { diff --git a/app/graphql/schema/types/shares/share.graphql b/app/graphql/schema/types/shares/share.graphql index b2f84ce24..a458d254c 100644 --- a/app/graphql/schema/types/shares/share.graphql +++ b/app/graphql/schema/types/shares/share.graphql @@ -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""" diff --git a/app/graphql/schema/types/unassigned-devices/unassigned-device.graphql b/app/graphql/schema/types/unassigned-devices/unassigned-device.graphql index 86764231a..d1b7bd4dd 100644 --- a/app/graphql/schema/types/unassigned-devices/unassigned-device.graphql +++ b/app/graphql/schema/types/unassigned-devices/unassigned-device.graphql @@ -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 { diff --git a/app/graphql/schema/types/users/me.graphql b/app/graphql/schema/types/users/me.graphql index 377b060aa..319cffedb 100644 --- a/app/graphql/schema/types/users/me.graphql +++ b/app/graphql/schema/types/users/me.graphql @@ -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 } \ No newline at end of file diff --git a/app/graphql/schema/types/users/user.graphql b/app/graphql/schema/types/users/user.graphql index 0a52e93f6..83d4e81d6 100644 --- a/app/graphql/schema/types/users/user.graphql +++ b/app/graphql/schema/types/users/user.graphql @@ -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""" diff --git a/app/graphql/schema/types/vars/vars.graphql b/app/graphql/schema/types/vars/vars.graphql index f080c907b..e2cba8faa 100644 --- a/app/graphql/schema/types/vars/vars.graphql +++ b/app/graphql/schema/types/vars/vars.graphql @@ -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 { diff --git a/app/graphql/schema/types/vms/domain.graphql b/app/graphql/schema/types/vms/domain.graphql index 36101fa25..866be9d49 100644 --- a/app/graphql/schema/types/vms/domain.graphql +++ b/app/graphql/schema/types/vms/domain.graphql @@ -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 { diff --git a/app/graphql/schema/types/vms/network.graphql b/app/graphql/schema/types/vms/network.graphql index 59253a74c..a91f793e7 100644 --- a/app/graphql/schema/types/vms/network.graphql +++ b/app/graphql/schema/types/vms/network.graphql @@ -10,11 +10,6 @@ type VmNetwork { _placeholderType: String } -type VmNetworksSubscription { - mutation: MutationType! - node: [VmNetwork!] -} - type Subscription { - vmNetworks: VmNetworksSubscription! + vmNetworks: [VmNetwork!] }