From 229743a650ce2d53f186a7f006ebf2d44e8d3fdb Mon Sep 17 00:00:00 2001 From: Marco <51787428+MarcoMruz@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:19:22 +0200 Subject: [PATCH] changed reconnection from query to mutation (#425) --- src/schema/api.graphql | 2 +- src/schema/global-types.ts | 15 +++++++++++++-- src/schema/nexus-typegen.ts | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/schema/api.graphql b/src/schema/api.graphql index 5c0809ce..d550e79f 100644 --- a/src/schema/api.graphql +++ b/src/schema/api.graphql @@ -411,6 +411,7 @@ type Mutation { deleteSnapshot(input: DeleteSnapshotInput!): DeleteSnapshotPayload importCSV(input: CSVImportInput!): CSVImport installDevice(id: String!): InstallDevicePayload! + reconnectKafka: IsOkResponse resetConfig(deviceId: String!, transactionId: String!): ResetConfigPayload! revertChanges(transactionId: String!): RevertChangesPayload! syncFromNetwork(deviceId: String!, transactionId: String!): SyncFromNetworkPayload! @@ -556,7 +557,6 @@ type Query { ptpPathToGrandMaster(deviceFrom: String!): [String!] ptpTopology: PtpTopology ptpTopologyVersionData(version: String!): PtpTopologyVersionData! - reconnectKafka: IsOkResponse shortestPath(from: String!, to: String!): [NetRoutingPathNode!]! syncePathToGrandMaster(deviceFrom: String!): [String!] synceTopology: SynceTopology diff --git a/src/schema/global-types.ts b/src/schema/global-types.ts index 252d2e8e..d1bc7bde 100644 --- a/src/schema/global-types.ts +++ b/src/schema/global-types.ts @@ -1,5 +1,16 @@ import countries from 'i18n-iso-countries'; -import { enumType, extendType, idArg, intArg, interfaceType, nonNull, objectType, queryField, stringArg } from 'nexus'; +import { + enumType, + extendType, + idArg, + intArg, + interfaceType, + mutationField, + nonNull, + objectType, + queryField, + stringArg, +} from 'nexus'; import { fromGraphId, getType } from '../helpers/id-helper'; export const Node = interfaceType({ @@ -130,7 +141,7 @@ export const KafkaHealthCheckQuery = queryField('kafkaHealthCheck', { }, }); -export const ReconnectKafkaMutation = queryField('reconnectKafka', { +export const ReconnectKafkaMutation = mutationField('reconnectKafka', { type: IsOkResponse, resolve: async (root, _, { kafka }) => { if (kafka == null) { diff --git a/src/schema/nexus-typegen.ts b/src/schema/nexus-typegen.ts index e2758e9e..b2495f0b 100644 --- a/src/schema/nexus-typegen.ts +++ b/src/schema/nexus-typegen.ts @@ -926,6 +926,7 @@ export interface NexusGenFieldTypes { deleteSnapshot: NexusGenRootTypes['DeleteSnapshotPayload'] | null; // DeleteSnapshotPayload importCSV: NexusGenRootTypes['CSVImport'] | null; // CSVImport installDevice: NexusGenRootTypes['InstallDevicePayload']; // InstallDevicePayload! + reconnectKafka: NexusGenRootTypes['IsOkResponse'] | null; // IsOkResponse resetConfig: NexusGenRootTypes['ResetConfigPayload']; // ResetConfigPayload! revertChanges: NexusGenRootTypes['RevertChangesPayload']; // RevertChangesPayload! syncFromNetwork: NexusGenRootTypes['SyncFromNetworkPayload']; // SyncFromNetworkPayload! @@ -1060,7 +1061,6 @@ export interface NexusGenFieldTypes { ptpPathToGrandMaster: string[] | null; // [String!] ptpTopology: NexusGenRootTypes['PtpTopology'] | null; // PtpTopology ptpTopologyVersionData: NexusGenRootTypes['PtpTopologyVersionData']; // PtpTopologyVersionData! - reconnectKafka: NexusGenRootTypes['IsOkResponse'] | null; // IsOkResponse shortestPath: NexusGenRootTypes['NetRoutingPathNode'][]; // [NetRoutingPathNode!]! syncePathToGrandMaster: string[] | null; // [String!] synceTopology: NexusGenRootTypes['SynceTopology'] | null; // SynceTopology @@ -1498,6 +1498,7 @@ export interface NexusGenFieldTypeNames { deleteSnapshot: 'DeleteSnapshotPayload'; importCSV: 'CSVImport'; installDevice: 'InstallDevicePayload'; + reconnectKafka: 'IsOkResponse'; resetConfig: 'ResetConfigPayload'; revertChanges: 'RevertChangesPayload'; syncFromNetwork: 'SyncFromNetworkPayload'; @@ -1632,7 +1633,6 @@ export interface NexusGenFieldTypeNames { ptpPathToGrandMaster: 'String'; ptpTopology: 'PtpTopology'; ptpTopologyVersionData: 'PtpTopologyVersionData'; - reconnectKafka: 'IsOkResponse'; shortestPath: 'NetRoutingPathNode'; syncePathToGrandMaster: 'String'; synceTopology: 'SynceTopology';