diff --git a/packages/data-context/src/sources/CloudDataSource.ts b/packages/data-context/src/sources/CloudDataSource.ts index d8948a91aa86..d43bcbab9a3d 100644 --- a/packages/data-context/src/sources/CloudDataSource.ts +++ b/packages/data-context/src/sources/CloudDataSource.ts @@ -402,11 +402,26 @@ function namedExecutionDocument (document: DocumentNode) { } hasReplaced = true + + const selectionSet = new Set() + + op.selectionSet.selections.forEach((s) => { + if (s.kind === 'Field') { + selectionSet.add(s.name.value) + } + }) + + let operationName = 'batchTestRunnerExecutionQuery' + + if (selectionSet.size > 0) { + operationName = `${operationName}_${Array.from(selectionSet).sort().join('_')}` + } + const namedOperationNode: OperationDefinitionNode = { ...op, name: { kind: 'Name', - value: 'batchTestRunnerExecutionQuery', + value: operationName, }, } diff --git a/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts b/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts index 79bd2b333768..87895f4fd502 100644 --- a/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts +++ b/packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts @@ -239,7 +239,7 @@ async function makeE2ETasks () { operationCount[operationName ?? 'unknown']++ - if (operationName === 'batchTestRunnerExecutionQuery' && remoteGraphQLInterceptBatched) { + if (operationName?.startsWith('batchTestRunnerExecutionQuery') && remoteGraphQLInterceptBatched) { const fn = remoteGraphQLInterceptBatched const keys: string[] = [] const values: Promise[] = []