@graphql-mesh/plugin-operation-headers
Version:
11 lines (10 loc) • 524 B
TypeScript
import type { MeshFetchRequestInit, OnFetchHook } from '@graphql-mesh/types';
export interface OperationHeadersFactoryPayload<TContext> {
context: TContext;
url: string;
options: MeshFetchRequestInit;
}
export type OperationHeadersFactory<TContext = any> = (payload: OperationHeadersFactoryPayload<TContext>) => Promise<Record<string, string>> | Record<string, string>;
export declare function useOperationHeaders<TContext>(factoryFn: OperationHeadersFactory<TContext>): {
onFetch: OnFetchHook<TContext>;
};