Skip to content

Commit daa3fb8

Browse files
committed
chore: remove unused withGraphFetched
1 parent f0d5047 commit daa3fb8

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

packages/backend/src/graphql/__tests__/mutations/update-step.itest.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,21 @@ describe('updateStep mutation', () => {
2020

2121
// Helper to create step mock with flow
2222
const createStepMock = (stepData: any = {}) => ({
23-
findOne: vi.fn().mockReturnValue({
24-
withGraphFetched: vi.fn().mockResolvedValue(
25-
stepData === null
26-
? null
27-
: {
28-
id: mockStepId,
29-
key: 'sendTransactionalEmail',
30-
appKey: 'postman',
31-
status: 'completed',
32-
flow: {
33-
id: mockFlowId,
34-
},
35-
patchFlowLastUpdated: patchFlowLastUpdatedSpy,
36-
...stepData,
23+
findOne: vi.fn().mockResolvedValue(
24+
stepData === null
25+
? null
26+
: {
27+
id: mockStepId,
28+
key: 'sendTransactionalEmail',
29+
appKey: 'postman',
30+
status: 'completed',
31+
flow: {
32+
id: mockFlowId,
3733
},
38-
),
39-
}),
34+
patchFlowLastUpdated: patchFlowLastUpdatedSpy,
35+
...stepData,
36+
},
37+
),
4038
})
4139

4240
// Helper to create connection mock

packages/backend/src/graphql/mutations/update-step.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ const updateStep: MutationResolvers['updateStep'] = async (
1313
const step = await Step.transaction(async (trx) => {
1414
await trx.raw('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;')
1515

16-
const step = await context.currentUser
17-
.$relatedQuery('steps', trx)
18-
.findOne({
19-
'steps.id': input.id,
20-
flow_id: input.flow.id,
21-
})
22-
.withGraphFetched('flow')
16+
const step = await context.currentUser.$relatedQuery('steps', trx).findOne({
17+
'steps.id': input.id,
18+
flow_id: input.flow.id,
19+
})
2320

2421
if (!step) {
2522
throw new BadUserInputError('Step not found')

0 commit comments

Comments
 (0)