Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update name for graphql batch operations #25610

Merged
merged 5 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/data-context/src/sources/CloudDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-shared/cypress/e2e/e2ePluginSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>[] = []
Expand Down