UNPKG

@graphql-mesh/serve-runtime

Version:
16 lines (15 loc) 716 B
import type { GatewayPlugin } from '../types'; interface FromClientToSubgraphsPayload { request: Request; subgraphName: string; } interface FromSubgraphsToClientPayload { response: Response; subgraphName: string; } export interface PropagateHeadersOpts { fromClientToSubgraphs?: (payload: FromClientToSubgraphsPayload) => Record<string, string> | void | Promise<Record<string, string | null | undefined> | void>; fromSubgraphsToClient?: (payload: FromSubgraphsToClientPayload) => Record<string, string> | void | Promise<Record<string, string | null | undefined> | void>; } export declare function usePropagateHeaders<TContext>(opts: PropagateHeadersOpts): GatewayPlugin<TContext>; export {};