@graphql-mocks/network-nock
Version:
Mock using graphql-mocks with Nock
9 lines (8 loc) • 467 B
TypeScript
import { GraphQLHandler } from 'graphql-mocks';
import { ReplyFnContext, ReplyFnResult, Body } from 'nock/types/index';
type ReplyFn = (this: ReplyFnContext, uri: string, body: Body) => ReplyFnResult | Promise<ReplyFnResult>;
export declare function nockHandler(graphqlHandler: GraphQLHandler, options?: {
checkRequest?: (request: ReplyFnContext['req'], body: Body) => void;
checkGraphQLResult?: (result: Record<string, any>) => void;
}): ReplyFn;
export {};