UNPKG

@graphql-mesh/plugin-operation-headers

Version:
10 lines (9 loc) 525 B
import type { MeshServeContext, MeshServePlugin } from '@graphql-mesh/serve-runtime'; import type { MeshFetchRequestInit } from '@graphql-mesh/types'; export interface OperationHeadersFactoryPayload { context: MeshServeContext; url: string; options: MeshFetchRequestInit; } export type OperationHeadersFactory = (payload: OperationHeadersFactoryPayload) => Promise<Record<string, string>> | Record<string, string>; export declare function useOperationHeaders(factoryFn: OperationHeadersFactory): MeshServePlugin;