From 3f2f1212c920ce67002d3ab8aee62a56fd032e4b Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Sun, 26 Dec 2021 13:41:46 +0300 Subject: [PATCH] chore: Use integer for IDs of resources --- packages/backend/src/apps/discord/info.json | 24 ++++++++++++------- packages/backend/src/apps/firebase/info.json | 24 ++++++++++++------- packages/backend/src/apps/flickr/info.json | 24 ++++++++++++------- packages/backend/src/apps/github/info.json | 24 ++++++++++++------- .../backend/src/apps/postgresql/info.json | 12 ++++++---- packages/backend/src/apps/smtp/info.json | 12 ++++++---- packages/backend/src/apps/twilio/info.json | 12 ++++++---- packages/backend/src/apps/twitch/info.json | 24 ++++++++++++------- packages/backend/src/apps/twitter/info.json | 24 ++++++++++++------- packages/backend/src/apps/typeform/info.json | 24 ++++++++++++------- .../src/graphql/mutations/create-auth-data.ts | 5 ++-- .../src/graphql/mutations/create-step.ts | 2 +- .../graphql/mutations/delete-connection.ts | 6 ++--- .../src/graphql/mutations/execute-step.ts | 6 ++--- .../src/graphql/mutations/reset-connection.ts | 6 ++--- .../graphql/mutations/update-connection.ts | 6 ++--- .../src/graphql/mutations/update-flow.ts | 2 +- .../graphql/mutations/verify-connection.ts | 6 ++--- .../backend/src/graphql/types/connection.ts | 4 ++-- packages/backend/src/graphql/types/flow.ts | 4 ++-- packages/backend/src/graphql/types/step.ts | 2 +- packages/backend/src/graphql/types/user.ts | 4 ++-- .../src/graphql/mutations/create-auth-data.ts | 2 +- .../graphql/mutations/delete-connection.ts | 2 +- .../src/graphql/mutations/reset-connection.ts | 2 +- .../graphql/mutations/update-connection.ts | 2 +- .../graphql/mutations/verify-connection.ts | 2 +- packages/web/src/graphql/queries/get-flow.ts | 4 ++-- .../src/graphql/queries/test-connection.ts | 4 ++-- 29 files changed, 172 insertions(+), 103 deletions(-) diff --git a/packages/backend/src/apps/discord/info.json b/packages/backend/src/apps/discord/info.json index 94292370..e5467af7 100644 --- a/packages/backend/src/apps/discord/info.json +++ b/packages/backend/src/apps/discord/info.json @@ -75,7 +75,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] }, @@ -97,7 +98,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" }, { "name": "data", @@ -118,7 +120,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -131,7 +134,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -142,7 +146,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -167,7 +172,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -189,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -210,7 +217,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/firebase/info.json b/packages/backend/src/apps/firebase/info.json index 4e1775ab..b075b2c5 100644 --- a/packages/backend/src/apps/firebase/info.json +++ b/packages/backend/src/apps/firebase/info.json @@ -75,7 +75,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] }, @@ -97,7 +98,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" }, { "name": "data", @@ -118,7 +120,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -131,7 +134,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -142,7 +146,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -167,7 +172,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -189,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -210,7 +217,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/flickr/info.json b/packages/backend/src/apps/flickr/info.json index 0ab9dc7f..b8e5177d 100644 --- a/packages/backend/src/apps/flickr/info.json +++ b/packages/backend/src/apps/flickr/info.json @@ -75,7 +75,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] }, @@ -97,7 +98,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" }, { "name": "data", @@ -118,7 +120,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -131,7 +134,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -142,7 +146,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -167,7 +172,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -189,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -210,7 +217,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/github/info.json b/packages/backend/src/apps/github/info.json index d5d6af57..febb4da3 100644 --- a/packages/backend/src/apps/github/info.json +++ b/packages/backend/src/apps/github/info.json @@ -75,7 +75,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] }, @@ -97,7 +98,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" }, { "name": "data", @@ -118,7 +120,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -131,7 +134,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -142,7 +146,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -167,7 +172,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -189,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -210,7 +217,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/postgresql/info.json b/packages/backend/src/apps/postgresql/info.json index fb8fa633..599009fc 100644 --- a/packages/backend/src/apps/postgresql/info.json +++ b/packages/backend/src/apps/postgresql/info.json @@ -127,7 +127,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -140,7 +141,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -151,7 +153,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -192,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/smtp/info.json b/packages/backend/src/apps/smtp/info.json index fc1ea420..1e0cea5d 100644 --- a/packages/backend/src/apps/smtp/info.json +++ b/packages/backend/src/apps/smtp/info.json @@ -127,7 +127,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -140,7 +141,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -151,7 +153,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -192,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/twilio/info.json b/packages/backend/src/apps/twilio/info.json index 3de5c3ea..19f63fad 100644 --- a/packages/backend/src/apps/twilio/info.json +++ b/packages/backend/src/apps/twilio/info.json @@ -63,7 +63,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -76,7 +77,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -87,7 +89,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -112,7 +115,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/twitch/info.json b/packages/backend/src/apps/twitch/info.json index 23059540..89879db0 100644 --- a/packages/backend/src/apps/twitch/info.json +++ b/packages/backend/src/apps/twitch/info.json @@ -75,7 +75,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] }, @@ -97,7 +98,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" }, { "name": "data", @@ -118,7 +120,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -131,7 +134,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -142,7 +146,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -167,7 +172,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -189,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -210,7 +217,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/twitter/info.json b/packages/backend/src/apps/twitter/info.json index 560c234e..637e355e 100644 --- a/packages/backend/src/apps/twitter/info.json +++ b/packages/backend/src/apps/twitter/info.json @@ -75,7 +75,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] }, @@ -97,7 +98,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" }, { "name": "data", @@ -118,7 +120,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -131,7 +134,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -142,7 +146,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -167,7 +172,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -189,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -210,7 +217,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/apps/typeform/info.json b/packages/backend/src/apps/typeform/info.json index 11cdf13b..d162d0c3 100644 --- a/packages/backend/src/apps/typeform/info.json +++ b/packages/backend/src/apps/typeform/info.json @@ -75,7 +75,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] }, @@ -97,7 +98,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" }, { "name": "data", @@ -118,7 +120,8 @@ "arguments": [ { "name": "id", - "value": "{createConnection.id}" + "value": "{createConnection.id}", + "type": "integer" } ] } @@ -131,7 +134,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -142,7 +146,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -167,7 +172,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] }, @@ -189,7 +195,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" }, { "name": "data", @@ -210,7 +217,8 @@ "arguments": [ { "name": "id", - "value": "{connection.id}" + "value": "{connection.id}", + "type": "integer" } ] } diff --git a/packages/backend/src/graphql/mutations/create-auth-data.ts b/packages/backend/src/graphql/mutations/create-auth-data.ts index eb1e719f..54292881 100644 --- a/packages/backend/src/graphql/mutations/create-auth-data.ts +++ b/packages/backend/src/graphql/mutations/create-auth-data.ts @@ -1,4 +1,4 @@ -import { GraphQLNonNull, GraphQLString } from 'graphql'; +import { GraphQLNonNull, GraphQLInt } from 'graphql'; import Connection from '../../models/connection'; import authLinkType from '../types/auth-link'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; @@ -6,6 +6,7 @@ import RequestWithCurrentUser from '../../types/express/request-with-current-use type Params = { id: number, } + const createAuthDataResolver = async (params: Params, req: RequestWithCurrentUser) => { const connection = await Connection.query().findOne({ user_id: req.currentUser.id, @@ -34,7 +35,7 @@ const createAuthDataResolver = async (params: Params, req: RequestWithCurrentUse const createAuthData = { type: authLinkType, args: { - id: { type: GraphQLNonNull(GraphQLString) }, + id: { type: GraphQLNonNull(GraphQLInt) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => createAuthDataResolver(params, req) }; diff --git a/packages/backend/src/graphql/mutations/create-step.ts b/packages/backend/src/graphql/mutations/create-step.ts index b4c9ed92..3366fe3a 100644 --- a/packages/backend/src/graphql/mutations/create-step.ts +++ b/packages/backend/src/graphql/mutations/create-step.ts @@ -32,7 +32,7 @@ const createStepResolver = async (params: Params, req: RequestWithCurrentUser) = const createStep = { type: stepType, args: { - flowId: { type: GraphQLNonNull(GraphQLString) }, + flowId: { type: GraphQLNonNull(GraphQLInt) }, key: { type: GraphQLNonNull(GraphQLString) }, appKey: { type: GraphQLNonNull(GraphQLString) }, type: { diff --git a/packages/backend/src/graphql/mutations/delete-connection.ts b/packages/backend/src/graphql/mutations/delete-connection.ts index cb2170ba..a8fd8d51 100644 --- a/packages/backend/src/graphql/mutations/delete-connection.ts +++ b/packages/backend/src/graphql/mutations/delete-connection.ts @@ -1,9 +1,9 @@ -import { GraphQLString, GraphQLNonNull, GraphQLBoolean } from 'graphql'; +import { GraphQLInt, GraphQLNonNull, GraphQLBoolean } from 'graphql'; import Connection from '../../models/connection'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: string, + id: number, data: object } const deleteConnectionResolver = async (params: Params, req: RequestWithCurrentUser) => { @@ -18,7 +18,7 @@ const deleteConnectionResolver = async (params: Params, req: RequestWithCurrentU const deleteConnection = { type: GraphQLBoolean, args: { - id: { type: GraphQLNonNull(GraphQLString) } + id: { type: GraphQLNonNull(GraphQLInt) } }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => deleteConnectionResolver(params, req) }; diff --git a/packages/backend/src/graphql/mutations/execute-step.ts b/packages/backend/src/graphql/mutations/execute-step.ts index 570c4e1e..2b772a74 100644 --- a/packages/backend/src/graphql/mutations/execute-step.ts +++ b/packages/backend/src/graphql/mutations/execute-step.ts @@ -1,4 +1,4 @@ -import { GraphQLString, GraphQLNonNull } from 'graphql'; +import { GraphQLInt, GraphQLNonNull } from 'graphql'; import App from '../../models/app'; import Connection from '../../models/connection'; import Step from '../../models/step'; @@ -6,7 +6,7 @@ import stepType from '../types/step'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: string, + id: number, data: object } const executeStepResolver = async (params: Params, req: RequestWithCurrentUser) => { @@ -28,7 +28,7 @@ const executeStepResolver = async (params: Params, req: RequestWithCurrentUser) const executeStep = { type: stepType, args: { - id: { type: GraphQLNonNull(GraphQLString) } + id: { type: GraphQLNonNull(GraphQLInt) } }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => executeStepResolver(params, req) }; diff --git a/packages/backend/src/graphql/mutations/reset-connection.ts b/packages/backend/src/graphql/mutations/reset-connection.ts index af67dd9a..fdfe68c3 100644 --- a/packages/backend/src/graphql/mutations/reset-connection.ts +++ b/packages/backend/src/graphql/mutations/reset-connection.ts @@ -1,10 +1,10 @@ -import { GraphQLString, GraphQLNonNull } from 'graphql'; +import { GraphQLInt, GraphQLNonNull } from 'graphql'; import Connection from '../../models/connection'; import connectionType from '../types/connection'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: string + id: number } const resetConnectionResolver = async (params: Params, req: RequestWithCurrentUser) => { @@ -23,7 +23,7 @@ const resetConnectionResolver = async (params: Params, req: RequestWithCurrentUs const resetConnection = { type: connectionType, args: { - id: { type: GraphQLNonNull(GraphQLString) }, + id: { type: GraphQLNonNull(GraphQLInt) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resetConnectionResolver(params, req) }; diff --git a/packages/backend/src/graphql/mutations/update-connection.ts b/packages/backend/src/graphql/mutations/update-connection.ts index aada26bc..e2114e2a 100644 --- a/packages/backend/src/graphql/mutations/update-connection.ts +++ b/packages/backend/src/graphql/mutations/update-connection.ts @@ -1,11 +1,11 @@ -import { GraphQLString, GraphQLNonNull } from 'graphql'; +import { GraphQLInt, GraphQLNonNull } from 'graphql'; import { GraphQLJSONObject } from 'graphql-type-json'; import Connection from '../../models/connection'; import connectionType from '../types/connection'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: string, + id: number, data: object } const updateConnectionResolver = async (params: Params, req: RequestWithCurrentUser) => { @@ -27,7 +27,7 @@ const updateConnectionResolver = async (params: Params, req: RequestWithCurrentU const updateConnection = { type: connectionType, args: { - id: { type: GraphQLNonNull(GraphQLString) }, + id: { type: GraphQLNonNull(GraphQLInt) }, data: { type: GraphQLNonNull(GraphQLJSONObject) } }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => updateConnectionResolver(params, req) diff --git a/packages/backend/src/graphql/mutations/update-flow.ts b/packages/backend/src/graphql/mutations/update-flow.ts index 5bc23062..e26682d4 100644 --- a/packages/backend/src/graphql/mutations/update-flow.ts +++ b/packages/backend/src/graphql/mutations/update-flow.ts @@ -4,7 +4,7 @@ import flowType from '../types/flow'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: string, + id: number, name: string } const updateFlowResolver = async (params: Params, req: RequestWithCurrentUser) => { diff --git a/packages/backend/src/graphql/mutations/verify-connection.ts b/packages/backend/src/graphql/mutations/verify-connection.ts index 21f2a0c4..b800a6e9 100644 --- a/packages/backend/src/graphql/mutations/verify-connection.ts +++ b/packages/backend/src/graphql/mutations/verify-connection.ts @@ -1,10 +1,10 @@ -import { GraphQLString, GraphQLNonNull } from 'graphql'; +import { GraphQLInt, GraphQLNonNull } from 'graphql'; import Connection from '../../models/connection'; import connectionType from '../types/connection'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: string + id: number } const verifyConnectionResolver = async (params: Params, req: RequestWithCurrentUser) => { let connection = await Connection.query().findOne({ @@ -31,7 +31,7 @@ const verifyConnectionResolver = async (params: Params, req: RequestWithCurrentU const verifyConnection = { type: connectionType, args: { - id: { type: GraphQLNonNull(GraphQLString) } + id: { type: GraphQLNonNull(GraphQLInt) } }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => verifyConnectionResolver(params, req) }; diff --git a/packages/backend/src/graphql/types/connection.ts b/packages/backend/src/graphql/types/connection.ts index 5ed068f1..21e1d554 100644 --- a/packages/backend/src/graphql/types/connection.ts +++ b/packages/backend/src/graphql/types/connection.ts @@ -1,4 +1,4 @@ -import { GraphQLObjectType, GraphQLString, GraphQLBoolean } from 'graphql'; +import { GraphQLObjectType, GraphQLString, GraphQLBoolean, GraphQLInt } from 'graphql'; import connectionDataType from './connection-data'; const connectionType = new GraphQLObjectType({ @@ -7,7 +7,7 @@ const connectionType = new GraphQLObjectType({ const appType = require('./app').default; return { - id: { type: GraphQLString }, + id: { type: GraphQLInt }, key: { type: GraphQLString }, data: { type: connectionDataType }, verified: { type: GraphQLBoolean }, diff --git a/packages/backend/src/graphql/types/flow.ts b/packages/backend/src/graphql/types/flow.ts index 15979569..53cb16f9 100644 --- a/packages/backend/src/graphql/types/flow.ts +++ b/packages/backend/src/graphql/types/flow.ts @@ -1,10 +1,10 @@ -import { GraphQLList, GraphQLObjectType, GraphQLString } from 'graphql'; +import { GraphQLList, GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql'; import StepType from './step'; const flowType = new GraphQLObjectType({ name: 'Flow', fields: { - id: { type: GraphQLString }, + id: { type: GraphQLInt }, name: { type: GraphQLString }, steps: { type: GraphQLList(StepType), diff --git a/packages/backend/src/graphql/types/step.ts b/packages/backend/src/graphql/types/step.ts index 037dd49f..60e75628 100644 --- a/packages/backend/src/graphql/types/step.ts +++ b/packages/backend/src/graphql/types/step.ts @@ -4,7 +4,7 @@ import ConnectionType from './connection'; const stepType = new GraphQLObjectType({ name: 'Step', fields: { - id: { type: GraphQLString }, + id: { type: GraphQLInt }, key: { type: GraphQLNonNull(GraphQLString) }, appKey: { type: GraphQLNonNull(GraphQLString) }, type: { diff --git a/packages/backend/src/graphql/types/user.ts b/packages/backend/src/graphql/types/user.ts index 4c72d345..f11e18e2 100644 --- a/packages/backend/src/graphql/types/user.ts +++ b/packages/backend/src/graphql/types/user.ts @@ -1,9 +1,9 @@ -import { GraphQLObjectType, GraphQLString, GraphQLList, GraphQLInt } from 'graphql'; +import { GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql'; const userType = new GraphQLObjectType({ name: 'User', fields: { - id: { type: GraphQLString }, + id: { type: GraphQLInt }, email: { type: GraphQLString }, createdAt: { type: GraphQLString }, updatedAt: { type: GraphQLString } diff --git a/packages/web/src/graphql/mutations/create-auth-data.ts b/packages/web/src/graphql/mutations/create-auth-data.ts index d7f03d59..44dcf1ef 100644 --- a/packages/web/src/graphql/mutations/create-auth-data.ts +++ b/packages/web/src/graphql/mutations/create-auth-data.ts @@ -1,7 +1,7 @@ import { gql } from '@apollo/client'; export const CREATE_AUTH_DATA = gql` - mutation createAuthData($id: String!) { + mutation createAuthData($id: Int!) { createAuthData(id: $id) { url } diff --git a/packages/web/src/graphql/mutations/delete-connection.ts b/packages/web/src/graphql/mutations/delete-connection.ts index 8020a5a6..bd86b3fd 100644 --- a/packages/web/src/graphql/mutations/delete-connection.ts +++ b/packages/web/src/graphql/mutations/delete-connection.ts @@ -1,7 +1,7 @@ import { gql } from '@apollo/client'; export const DELETE_CONNECTION = gql` - mutation DeleteConnection($id: String!) { + mutation DeleteConnection($id: Int!) { deleteConnection(id: $id) } `; diff --git a/packages/web/src/graphql/mutations/reset-connection.ts b/packages/web/src/graphql/mutations/reset-connection.ts index 7b4f6686..7b3a1f09 100644 --- a/packages/web/src/graphql/mutations/reset-connection.ts +++ b/packages/web/src/graphql/mutations/reset-connection.ts @@ -1,7 +1,7 @@ import { gql } from '@apollo/client'; export const RESET_CONNECTION = gql` - mutation ResetConnection($id: String!) { + mutation ResetConnection($id: Int!) { resetConnection(id: $id) { id } diff --git a/packages/web/src/graphql/mutations/update-connection.ts b/packages/web/src/graphql/mutations/update-connection.ts index a2b617b7..2159693a 100644 --- a/packages/web/src/graphql/mutations/update-connection.ts +++ b/packages/web/src/graphql/mutations/update-connection.ts @@ -1,7 +1,7 @@ import { gql } from '@apollo/client'; export const UPDATE_CONNECTION = gql` - mutation UpdateConnection($id: String!, $data: JSONObject!) { + mutation UpdateConnection($id: Int!, $data: JSONObject!) { updateConnection(id: $id, data: $data) { id key diff --git a/packages/web/src/graphql/mutations/verify-connection.ts b/packages/web/src/graphql/mutations/verify-connection.ts index 7233798b..5710304d 100644 --- a/packages/web/src/graphql/mutations/verify-connection.ts +++ b/packages/web/src/graphql/mutations/verify-connection.ts @@ -1,7 +1,7 @@ import { gql } from '@apollo/client'; export const VERIFY_CONNECTION = gql` - mutation VerifyConnection($id: String!) { + mutation VerifyConnection($id: Int!) { verifyConnection(id: $id) { id verified diff --git a/packages/web/src/graphql/queries/get-flow.ts b/packages/web/src/graphql/queries/get-flow.ts index 1d1714cb..047525d9 100644 --- a/packages/web/src/graphql/queries/get-flow.ts +++ b/packages/web/src/graphql/queries/get-flow.ts @@ -1,7 +1,7 @@ import { gql } from '@apollo/client'; export const GET_FLOW = gql` - query GetFlow($id: String!) { + query GetFlow($id: Int!) { getFlow(id: $id) { id name @@ -14,4 +14,4 @@ export const GET_FLOW = gql` } } } -`; \ No newline at end of file +`; diff --git a/packages/web/src/graphql/queries/test-connection.ts b/packages/web/src/graphql/queries/test-connection.ts index 83771f87..0955c315 100644 --- a/packages/web/src/graphql/queries/test-connection.ts +++ b/packages/web/src/graphql/queries/test-connection.ts @@ -1,10 +1,10 @@ import { gql } from '@apollo/client'; export const TEST_CONNECTION = gql` - query TestConnection($id: String!) { + query TestConnection($id: Int!) { testConnection(id: $id) { id verified } } -`; \ No newline at end of file +`;