diff --git a/packages/backend/src/graphql/mutations/create-auth-data.ts b/packages/backend/src/graphql/mutations/create-auth-data.ts index 973b9dc3..9762d5f3 100644 --- a/packages/backend/src/graphql/mutations/create-auth-data.ts +++ b/packages/backend/src/graphql/mutations/create-auth-data.ts @@ -1,10 +1,9 @@ -import { GraphQLNonNull, GraphQLInt } from 'graphql'; -import Connection from '../../models/connection'; +import { GraphQLNonNull, GraphQLString } from 'graphql'; import authLinkType from '../types/auth-link'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: number; + id: string; }; const createAuthDataResolver = async ( @@ -40,7 +39,7 @@ const createAuthDataResolver = async ( const createAuthData = { type: authLinkType, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => createAuthDataResolver(params, req), diff --git a/packages/backend/src/graphql/mutations/create-flow.ts b/packages/backend/src/graphql/mutations/create-flow.ts index a38d403c..1920c7b3 100644 --- a/packages/backend/src/graphql/mutations/create-flow.ts +++ b/packages/backend/src/graphql/mutations/create-flow.ts @@ -3,7 +3,7 @@ import flowType from '../types/flow'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; const createFlowResolver = async (req: RequestWithCurrentUser) => { - const flow = await req.currentUser.$relatedQuery('flows').insert(); + const flow = await req.currentUser.$relatedQuery('flows').insert({}); await Step.query().insert({ flowId: flow.id, diff --git a/packages/backend/src/graphql/mutations/delete-connection.ts b/packages/backend/src/graphql/mutations/delete-connection.ts index 686a1cd5..2a159524 100644 --- a/packages/backend/src/graphql/mutations/delete-connection.ts +++ b/packages/backend/src/graphql/mutations/delete-connection.ts @@ -1,8 +1,8 @@ -import { GraphQLInt, GraphQLNonNull, GraphQLBoolean } from 'graphql'; +import { GraphQLString, GraphQLNonNull, GraphQLBoolean } from 'graphql'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: number; + id: string; data: object; }; const deleteConnectionResolver = async ( @@ -23,7 +23,7 @@ const deleteConnectionResolver = async ( const deleteConnection = { type: GraphQLBoolean, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => deleteConnectionResolver(params, req), diff --git a/packages/backend/src/graphql/mutations/delete-step.ts b/packages/backend/src/graphql/mutations/delete-step.ts index 2a000887..1cdc490a 100644 --- a/packages/backend/src/graphql/mutations/delete-step.ts +++ b/packages/backend/src/graphql/mutations/delete-step.ts @@ -1,9 +1,9 @@ -import { GraphQLInt, GraphQLNonNull, GraphQLBoolean } from 'graphql'; +import { GraphQLString, GraphQLNonNull, GraphQLBoolean } from 'graphql'; import Step from '../../models/step'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: number; + id: string; }; const deleteStepResolver = async ( @@ -24,7 +24,7 @@ const deleteStepResolver = async ( const deleteStep = { type: GraphQLBoolean, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => deleteStepResolver(params, req), diff --git a/packages/backend/src/graphql/mutations/execute-step.ts b/packages/backend/src/graphql/mutations/execute-step.ts index 37494c37..f47913be 100644 --- a/packages/backend/src/graphql/mutations/execute-step.ts +++ b/packages/backend/src/graphql/mutations/execute-step.ts @@ -1,34 +1,38 @@ -import { GraphQLInt, GraphQLNonNull } from 'graphql'; +import { GraphQLString, GraphQLNonNull } from 'graphql'; import Connection from '../../models/connection'; import Step from '../../models/step'; import stepType from '../types/step'; type Params = { - id: number, - data: Record -} + id: string; + data: Record; +}; const executeStepResolver = async (params: Params): Promise => { - const step = await Step.query().findOne({ - id: params.id - }).throwIfNotFound(); + const step = await Step.query() + .findOne({ + id: params.id, + }) + .throwIfNotFound(); - const connection = await Connection.query().findOne({ - id: step.connectionId - }).throwIfNotFound(); + const connection = await Connection.query() + .findOne({ + id: step.connectionId, + }) + .throwIfNotFound(); const appClass = (await import(`../../apps/${step.appKey}`)).default; const appInstance = new appClass(connection.data); await appInstance.triggers[step.key].run(); return step; -} +}; const executeStep = { type: stepType, args: { - id: { type: GraphQLNonNull(GraphQLInt) } + id: { type: GraphQLNonNull(GraphQLString) }, }, - resolve: (_: any, params: Params) => executeStepResolver(params) + resolve: (_: any, params: Params) => executeStepResolver(params), }; export default executeStep; diff --git a/packages/backend/src/graphql/mutations/reset-connection.ts b/packages/backend/src/graphql/mutations/reset-connection.ts index ea50a920..12aab03b 100644 --- a/packages/backend/src/graphql/mutations/reset-connection.ts +++ b/packages/backend/src/graphql/mutations/reset-connection.ts @@ -1,9 +1,9 @@ -import { GraphQLInt, GraphQLNonNull } from 'graphql'; +import { GraphQLString, GraphQLNonNull } from 'graphql'; import connectionType from '../types/connection'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: number; + id: string; }; const resetConnectionResolver = async ( @@ -27,7 +27,7 @@ const resetConnectionResolver = async ( const resetConnection = { type: connectionType, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, }, 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 2b6da649..c07d9348 100644 --- a/packages/backend/src/graphql/mutations/update-connection.ts +++ b/packages/backend/src/graphql/mutations/update-connection.ts @@ -1,12 +1,13 @@ -import { GraphQLInt, GraphQLNonNull } from 'graphql'; +import { GraphQLString, GraphQLNonNull } from 'graphql'; import { GraphQLJSONObject } from 'graphql-type-json'; import connectionType from '../types/connection'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: number; + id: string; data: object; }; + const updateConnectionResolver = async ( params: Params, req: RequestWithCurrentUser @@ -31,7 +32,7 @@ const updateConnectionResolver = async ( const updateConnection = { type: connectionType, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, data: { type: GraphQLNonNull(GraphQLJSONObject) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => diff --git a/packages/backend/src/graphql/mutations/update-flow.ts b/packages/backend/src/graphql/mutations/update-flow.ts index 79d86256..7eb09493 100644 --- a/packages/backend/src/graphql/mutations/update-flow.ts +++ b/packages/backend/src/graphql/mutations/update-flow.ts @@ -1,11 +1,12 @@ -import { GraphQLInt, GraphQLString, GraphQLNonNull } from 'graphql'; +import { GraphQLString, GraphQLNonNull } from 'graphql'; import flowType from '../types/flow'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: number; + id: string; name: string; }; + const updateFlowResolver = async ( params: Params, req: RequestWithCurrentUser @@ -28,7 +29,7 @@ const updateFlowResolver = async ( const updateFlow = { type: flowType, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, name: { type: GraphQLNonNull(GraphQLString) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => diff --git a/packages/backend/src/graphql/mutations/update-step.ts b/packages/backend/src/graphql/mutations/update-step.ts index 6817c10e..8c0732cf 100644 --- a/packages/backend/src/graphql/mutations/update-step.ts +++ b/packages/backend/src/graphql/mutations/update-step.ts @@ -5,15 +5,15 @@ import RequestWithCurrentUser from '../../types/express/request-with-current-use type Params = { input: { - id: number; + id: string; key: string; appKey: string; parameters: string; flow: { - id: number; + id: string; }; connection: { - id: number; + id: string; }; }; }; diff --git a/packages/backend/src/graphql/mutations/verify-connection.ts b/packages/backend/src/graphql/mutations/verify-connection.ts index 8531c200..4f4d3866 100644 --- a/packages/backend/src/graphql/mutations/verify-connection.ts +++ b/packages/backend/src/graphql/mutations/verify-connection.ts @@ -1,10 +1,11 @@ -import { GraphQLInt, GraphQLNonNull } from 'graphql'; +import { GraphQLString, GraphQLNonNull } from 'graphql'; import connectionType from '../types/connection'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; type Params = { - id: number; + id: string; }; + const verifyConnectionResolver = async ( params: Params, req: RequestWithCurrentUser @@ -36,7 +37,7 @@ const verifyConnectionResolver = async ( const verifyConnection = { type: connectionType, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => verifyConnectionResolver(params, req), diff --git a/packages/backend/src/graphql/queries/get-flow.ts b/packages/backend/src/graphql/queries/get-flow.ts index 2efe5dc9..64735716 100644 --- a/packages/backend/src/graphql/queries/get-flow.ts +++ b/packages/backend/src/graphql/queries/get-flow.ts @@ -1,9 +1,9 @@ -import { GraphQLNonNull, GraphQLInt } from 'graphql'; +import { GraphQLNonNull, GraphQLString } from 'graphql'; import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import flowType from '../types/flow'; type Params = { - id: number; + id: string; }; const getFlowResolver = async (params: Params, req: RequestWithCurrentUser) => { @@ -20,7 +20,7 @@ const getFlowResolver = async (params: Params, req: RequestWithCurrentUser) => { const getFlow = { type: flowType, args: { - id: { type: GraphQLNonNull(GraphQLInt) }, + id: { type: GraphQLNonNull(GraphQLString) }, }, resolve: (_: any, params: Params, req: RequestWithCurrentUser) => getFlowResolver(params, req), diff --git a/packages/backend/src/graphql/types/connection.ts b/packages/backend/src/graphql/types/connection.ts index fb4d9f45..e9093cb9 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, GraphQLInt } from 'graphql'; +import { GraphQLObjectType, GraphQLString, GraphQLBoolean } from 'graphql'; import connectionDataType from './connection-data'; const connectionType = new GraphQLObjectType({ @@ -8,14 +8,14 @@ const connectionType = new GraphQLObjectType({ const appType = require('./app').default; return { - id: { type: GraphQLInt }, + id: { type: GraphQLString }, key: { type: GraphQLString }, data: { type: connectionDataType }, verified: { type: GraphQLBoolean }, app: { type: appType }, - createdAt: { type: GraphQLString } - } - } -}) + createdAt: { type: GraphQLString }, + }; + }, +}); export default connectionType; diff --git a/packages/backend/src/graphql/types/flow.ts b/packages/backend/src/graphql/types/flow.ts index 1cb3557a..627f4f21 100644 --- a/packages/backend/src/graphql/types/flow.ts +++ b/packages/backend/src/graphql/types/flow.ts @@ -1,16 +1,21 @@ -import { GraphQLList, GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLBoolean } from 'graphql'; +import { + GraphQLList, + GraphQLObjectType, + GraphQLString, + GraphQLBoolean, +} from 'graphql'; import StepType from './step'; const flowType = new GraphQLObjectType({ name: 'Flow', fields: { - id: { type: GraphQLInt }, + id: { type: GraphQLString }, name: { type: GraphQLString }, active: { type: GraphQLBoolean }, steps: { type: GraphQLList(StepType), - } - } -}) + }, + }, +}); export default flowType; diff --git a/packages/backend/src/graphql/types/step.ts b/packages/backend/src/graphql/types/step.ts index fbc41275..018edce7 100644 --- a/packages/backend/src/graphql/types/step.ts +++ b/packages/backend/src/graphql/types/step.ts @@ -10,8 +10,8 @@ import ConnectionType from './connection'; const stepType = new GraphQLObjectType({ name: 'Step', fields: { - id: { type: GraphQLInt }, - previousStepId: { type: GraphQLInt }, + id: { type: GraphQLString }, + previousStepId: { type: GraphQLString }, key: { type: GraphQLString }, appKey: { type: GraphQLString }, type: { @@ -32,15 +32,15 @@ const stepType = new GraphQLObjectType({ export const stepInputType = new GraphQLInputObjectType({ name: 'StepInput', fields: { - id: { type: GraphQLInt }, - previousStepId: { type: GraphQLInt }, + id: { type: GraphQLString }, + previousStepId: { type: GraphQLString }, key: { type: GraphQLString }, appKey: { type: GraphQLString }, connection: { type: new GraphQLInputObjectType({ name: 'StepConnectionInput', fields: { - id: { type: GraphQLInt }, + id: { type: GraphQLString }, }, }), }, @@ -48,7 +48,7 @@ export const stepInputType = new GraphQLInputObjectType({ type: new GraphQLInputObjectType({ name: 'StepFlowInput', fields: { - id: { type: GraphQLInt }, + id: { type: GraphQLString }, }, }), }, @@ -57,7 +57,7 @@ export const stepInputType = new GraphQLInputObjectType({ type: new GraphQLInputObjectType({ name: 'PreviousStepInput', fields: { - id: { type: GraphQLInt }, + id: { type: GraphQLString }, }, }), }, diff --git a/packages/backend/src/graphql/types/user.ts b/packages/backend/src/graphql/types/user.ts index f11e18e2..c03104c4 100644 --- a/packages/backend/src/graphql/types/user.ts +++ b/packages/backend/src/graphql/types/user.ts @@ -1,13 +1,13 @@ -import { GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql'; +import { GraphQLObjectType, GraphQLString } from 'graphql'; const userType = new GraphQLObjectType({ name: 'User', fields: { - id: { type: GraphQLInt }, + id: { type: GraphQLString }, email: { type: GraphQLString }, createdAt: { type: GraphQLString }, - updatedAt: { type: GraphQLString } - } -}) + updatedAt: { type: GraphQLString }, + }, +}); export default userType; diff --git a/packages/backend/src/models/connection.ts b/packages/backend/src/models/connection.ts index 893acc43..146daa38 100644 --- a/packages/backend/src/models/connection.ts +++ b/packages/backend/src/models/connection.ts @@ -1,23 +1,23 @@ import { QueryContext, ModelOptions } from 'objection'; import type { RelationMappings } from 'objection'; import { AES, enc } from 'crypto-js'; -import Base from './base' -import User from './user' +import Base from './base'; +import User from './user'; import appConfig from '../config/app'; class Connection extends Base { - id!: number - key!: string - data!: any - userId!: number - verified: boolean - count: number + id!: number; + key!: string; + data!: any; + userId!: number; + verified: boolean; + count: number; static tableName = 'connections'; static jsonSchema = { type: 'object', - required: ['key', 'data', 'userId'], + required: ['key', 'data'], properties: { id: { type: 'integer' }, @@ -25,8 +25,8 @@ class Connection extends Base { data: { type: 'object' }, userId: { type: 'integer' }, verified: { type: 'boolean' }, - } - } + }, + }; static relationMappings = (): RelationMappings => ({ user: { @@ -36,21 +36,26 @@ class Connection extends Base { from: 'connections.user_id', to: 'users.id', }, - } - }) + }, + }); encryptData(): void { - if(!this.eligibleForEncryption()) return; - this.data = AES.encrypt(JSON.stringify(this.data), appConfig.encryptionKey).toString(); + if (!this.eligibleForEncryption()) return; + this.data = AES.encrypt( + JSON.stringify(this.data), + appConfig.encryptionKey + ).toString(); } decryptData(): void { - if(!this.eligibleForEncryption()) return; - this.data = JSON.parse(AES.decrypt(this.data, appConfig.encryptionKey).toString(enc.Utf8)); + if (!this.eligibleForEncryption()) return; + this.data = JSON.parse( + AES.decrypt(this.data, appConfig.encryptionKey).toString(enc.Utf8) + ); } eligibleForEncryption(): boolean { - return this.data ? true : false + return this.data ? true : false; } // TODO: Make another abstraction like beforeSave instead of using @@ -60,7 +65,10 @@ class Connection extends Base { this.encryptData(); } - async $beforeUpdate(opt: ModelOptions, queryContext: QueryContext): Promise { + async $beforeUpdate( + opt: ModelOptions, + queryContext: QueryContext + ): Promise { await super.$beforeUpdate(opt, queryContext); this.encryptData(); } diff --git a/packages/backend/src/models/step.ts b/packages/backend/src/models/step.ts index e389b6c8..d637c616 100644 --- a/packages/backend/src/models/step.ts +++ b/packages/backend/src/models/step.ts @@ -27,7 +27,7 @@ class Step extends Base { id: { type: 'integer' }, flowId: { type: 'integer' }, key: { type: ['string', null] }, - appKey: { type: 'string', minLength: 1, maxLength: 255 }, + appKey: { type: ['string', null], minLength: 1, maxLength: 255 }, type: { type: 'string', enum: ['action', 'trigger'] }, connectionId: { type: ['integer', null] }, position: { type: 'integer' }, diff --git a/packages/web/src/components/Editor/index.tsx b/packages/web/src/components/Editor/index.tsx index 5ceba84e..bb4d76b6 100644 --- a/packages/web/src/components/Editor/index.tsx +++ b/packages/web/src/components/Editor/index.tsx @@ -14,13 +14,10 @@ import type { Step } from 'types/step'; type EditorProps = { flow: Flow; -} +}; -function updateHandlerFactory(flowId: number, previousStepId: number) { - return function createStepUpdateHandler( - cache: any, - mutationResult: any, - ) { +function updateHandlerFactory(flowId: string, previousStepId: string) { + return function createStepUpdateHandler(cache: any, mutationResult: any) { const { data } = mutationResult; const { createStep: createdStep } = data; const { getFlow: flow } = cache.readQuery({ @@ -40,7 +37,7 @@ function updateHandlerFactory(flowId: number, previousStepId: number) { variables: { id: flowId }, data: { getFlow: { ...flow, steps } }, }); - } + }; } export default function Editor(props: EditorProps): React.ReactElement { @@ -49,41 +46,47 @@ export default function Editor(props: EditorProps): React.ReactElement { const [currentStep, setCurrentStep] = React.useState(0); const { flow } = props; - const onStepChange = React.useCallback((step: any) => { - const mutationInput: Record = { - id: step.id, - key: step.key, - parameters: JSON.stringify(step.parameters, null, 2), - connection: { - id: step.connection?.id - }, - flow: { - id: flow.id, - }, - }; + const onStepChange = React.useCallback( + (step: any) => { + const mutationInput: Record = { + id: step.id, + key: step.key, + parameters: JSON.stringify(step.parameters, null, 2), + connection: { + id: step.connection?.id, + }, + flow: { + id: flow.id, + }, + }; - if (step.appKey) { - mutationInput.appKey = step.appKey; - } + if (step.appKey) { + mutationInput.appKey = step.appKey; + } - updateStep({ variables: { input: mutationInput } }); - }, [updateStep, flow.id]); + updateStep({ variables: { input: mutationInput } }); + }, + [updateStep, flow.id] + ); - const addStep = React.useCallback((previousStepId) => { - const mutationInput = { - previousStep: { - id: previousStepId, - }, - flow: { - id: flow.id, - }, - }; + const addStep = React.useCallback( + (previousStepId) => { + const mutationInput = { + previousStep: { + id: previousStepId, + }, + flow: { + id: flow.id, + }, + }; - createStep({ - variables: { input: mutationInput }, - update: updateHandlerFactory(flow.id, previousStepId), - }); - }, [createStep, flow.id]); + createStep({ + variables: { input: mutationInput }, + update: updateHandlerFactory(flow.id, previousStepId), + }); + }, + [createStep, flow.id] + ); return ( ))} - ) -}; + ); +} diff --git a/packages/web/src/graphql/mutations/create-auth-data.ts b/packages/web/src/graphql/mutations/create-auth-data.ts index 44dcf1ef..d7f03d59 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: Int!) { + mutation createAuthData($id: String!) { 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 bd86b3fd..8020a5a6 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: Int!) { + mutation DeleteConnection($id: String!) { deleteConnection(id: $id) } `; diff --git a/packages/web/src/graphql/mutations/reset-connection.ts b/packages/web/src/graphql/mutations/reset-connection.ts index 7b3a1f09..7b4f6686 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: Int!) { + mutation ResetConnection($id: String!) { 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 2159693a..a2b617b7 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: Int!, $data: JSONObject!) { + mutation UpdateConnection($id: String!, $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 5710304d..7233798b 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: Int!) { + mutation VerifyConnection($id: String!) { 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 74e823d5..267c9163 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: Int!) { + query GetFlow($id: String!) { getFlow(id: $id) { id name diff --git a/packages/web/src/graphql/queries/test-connection.ts b/packages/web/src/graphql/queries/test-connection.ts index 0955c315..15ae96b1 100644 --- a/packages/web/src/graphql/queries/test-connection.ts +++ b/packages/web/src/graphql/queries/test-connection.ts @@ -1,7 +1,7 @@ import { gql } from '@apollo/client'; export const TEST_CONNECTION = gql` - query TestConnection($id: Int!) { + query TestConnection($id: String!) { testConnection(id: $id) { id verified diff --git a/packages/web/src/types/flow.ts b/packages/web/src/types/flow.ts index 84e96df0..32d6770c 100644 --- a/packages/web/src/types/flow.ts +++ b/packages/web/src/types/flow.ts @@ -1,7 +1,7 @@ import type { Step } from './step'; export type Flow = { - id: number; + id: string; name: string; steps: Step[]; active: boolean; diff --git a/packages/web/src/types/step.ts b/packages/web/src/types/step.ts index 73b692a0..d96d7d99 100644 --- a/packages/web/src/types/step.ts +++ b/packages/web/src/types/step.ts @@ -9,9 +9,9 @@ export type Step = { name: string; appKey: string; type: StepType; - previousStepId: number | null; + previousStepId: string | null; parameters: Record; connection: { - id: number; + id: string; }; };