diff --git a/e2e/apq-subgraphs/gateway.config.ts b/e2e/apq-subgraphs/gateway.config.ts new file mode 100644 index 00000000..4f1488f3 --- /dev/null +++ b/e2e/apq-subgraphs/gateway.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from '@graphql-hive/gateway'; + +let fetchCnt = 0; +export const gatewayConfig = defineConfig({ + transportEntries: { + greetings: { + options: { + apq: true, + }, + }, + }, + plugins: () => [ + { + onFetch({ options }) { + fetchCnt++; + process.stdout.write(`fetch ${fetchCnt} ${options.body}\n`); + }, + }, + ], +}); diff --git a/e2e/apq-subgraphs/mesh.config.ts b/e2e/apq-subgraphs/mesh.config.ts index 1fc269b8..7c7660f0 100644 --- a/e2e/apq-subgraphs/mesh.config.ts +++ b/e2e/apq-subgraphs/mesh.config.ts @@ -1,13 +1,12 @@ -import { defineConfig as defineGatewayConfig } from '@graphql-hive/gateway'; import { - defineConfig as defineComposeConfig, + defineConfig, loadGraphQLHTTPSubgraph, } from '@graphql-mesh/compose-cli'; import { Opts } from '@internal/testing'; const opts = Opts(process.argv); -export const composeConfig = defineComposeConfig({ +export const composeConfig = defineConfig({ subgraphs: [ { sourceHandler: loadGraphQLHTTPSubgraph('greetings', { @@ -16,22 +15,3 @@ export const composeConfig = defineComposeConfig({ }, ], }); - -let fetchCnt = 0; -export const gatewayConfig = defineGatewayConfig({ - transportEntries: { - greetings: { - options: { - apq: true, - }, - }, - }, - plugins: () => [ - { - onFetch({ options }) { - fetchCnt++; - process.stdout.write(`fetch ${fetchCnt} ${options.body}\n`); - }, - }, - ], -}); diff --git a/internal/e2e/src/tenv.ts b/internal/e2e/src/tenv.ts index 455534f7..425f9b08 100644 --- a/internal/e2e/src/tenv.ts +++ b/internal/e2e/src/tenv.ts @@ -401,7 +401,7 @@ export function createTenv(cwd: string): Tenv { subgraph = await handleDockerHostName(subgraph, volumes); } - for (const configfile of await glob('@(mesh|gateway).config.*', { + for (const configfile of await glob('gateway.config.*', { cwd, })) { volumes.push({