UNPKG

668 BTypeScriptView Raw
1import { ApolloError, Operation as LinkOperation, FetchResult } from '@apollo/client/core';
2import { GraphQLError, ExecutionResult } from 'graphql';
3import { Observer } from 'rxjs';
4export declare type Operation = LinkOperation & {
5 clientName: string;
6};
7export declare class TestOperation<T = {
8 [key: string]: any;
9}> {
10 operation: Operation;
11 private observer;
12 constructor(operation: Operation, observer: Observer<FetchResult<T>>);
13 flush(result: ExecutionResult | ApolloError): void;
14 flushData(data: {
15 [key: string]: any;
16 } | null): void;
17 networkError(error: Error): void;
18 graphqlErrors(errors: GraphQLError[]): void;
19}