Skip to content

Commit f56d80e

Browse files
committed
fix typings
1 parent c4e1905 commit f56d80e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/runtime/src/plugins/useSubgraphExecuteDebug.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import { defaultPrintFn } from '@graphql-mesh/transport-common';
2-
import { FetchAPI, isAsyncIterable } from 'graphql-yoga';
2+
import { isAsyncIterable } from 'graphql-yoga';
33
import type { GatewayPlugin } from '../types';
44

55
export function useSubgraphExecuteDebug<
66
TContext extends Record<string, any>,
77
>(): GatewayPlugin<TContext> {
8-
let fetchAPI: FetchAPI;
98
return {
10-
onYogaInit({ yoga }) {
11-
fetchAPI = yoga.fetchAPI;
12-
},
139
onSubgraphExecute({ executionRequest }) {
1410
let log = executionRequest.context?.log.child(
1511
'[useSubgraphExecuteDebug] ',

packages/transports/http/tests/http.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
import { LegacyLogger, Logger } from '@graphql-hive/logger';
12
import { TransportEntry } from '@graphql-mesh/transport-common';
23
import type { MeshFetch } from '@graphql-mesh/types';
34
import { buildSchema, OperationTypeNode, parse } from 'graphql';
45
import { describe, expect, it, vi } from 'vitest';
56
import httpTransport from '../src';
67

78
describe('HTTP Transport', () => {
9+
const log = new Logger({ level: false });
10+
const logger = new LegacyLogger(log);
11+
812
const subgraphName = 'test';
913
it('interpolate the strings in headers', async () => {
1014
const fetch = vi.fn<MeshFetch>(async () =>
@@ -17,6 +21,8 @@ describe('HTTP Transport', () => {
1721
const expectedToken = 'wowmuchsecret';
1822
const getTransportExecutor = (transportEntry: TransportEntry) =>
1923
httpTransport.getSubgraphExecutor({
24+
log,
25+
logger,
2026
subgraphName,
2127
transportEntry,
2228
fetch,
@@ -56,6 +62,8 @@ describe('HTTP Transport', () => {
5662

5763
const getTransportExecutor = (transportEntry: TransportEntry) =>
5864
httpTransport.getSubgraphExecutor({
65+
log,
66+
logger,
5967
subgraphName,
6068
transportEntry,
6169
fetch,

0 commit comments

Comments
 (0)