Skip to content

Commit

Permalink
changed reconnection from query to mutation (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoMruz authored Apr 30, 2024
1 parent 172e644 commit 229743a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/schema/api.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions src/schema/global-types.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/schema/nexus-typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1498,6 +1498,7 @@ export interface NexusGenFieldTypeNames {
deleteSnapshot: 'DeleteSnapshotPayload';
importCSV: 'CSVImport';
installDevice: 'InstallDevicePayload';
reconnectKafka: 'IsOkResponse';
resetConfig: 'ResetConfigPayload';
revertChanges: 'RevertChangesPayload';
syncFromNetwork: 'SyncFromNetworkPayload';
Expand Down Expand Up @@ -1632,7 +1633,6 @@ export interface NexusGenFieldTypeNames {
ptpPathToGrandMaster: 'String';
ptpTopology: 'PtpTopology';
ptpTopologyVersionData: 'PtpTopologyVersionData';
reconnectKafka: 'IsOkResponse';
shortestPath: 'NetRoutingPathNode';
syncePathToGrandMaster: 'String';
synceTopology: 'SynceTopology';
Expand Down

0 comments on commit 229743a

Please sign in to comment.