1 | import { ApolloServerBase } from 'apollo-server-core';
|
2 | import { GraphQLResponse as GraphQLResponseType } from 'apollo-server-types';
|
3 | import { DocumentNode } from 'graphql';
|
4 | declare type StringOrAst = string | DocumentNode;
|
5 | declare type Query<TVariables = Record<string, any>> = {
|
6 | query: StringOrAst;
|
7 | mutation?: undefined;
|
8 | variables?: TVariables;
|
9 | operationName?: string;
|
10 | };
|
11 | declare type Mutation<TVariables = Record<string, any>> = {
|
12 | mutation: StringOrAst;
|
13 | query?: undefined;
|
14 | variables?: TVariables;
|
15 | operationName?: string;
|
16 | };
|
17 | declare type GraphQLResponse<TData> = Omit<GraphQLResponseType, 'data'> & {
|
18 | data?: TData;
|
19 | };
|
20 | export interface ApolloServerTestClient {
|
21 | query<TData = any, TVariables = Record<string, any>>(query: Query<TVariables>): Promise<GraphQLResponse<TData>>;
|
22 | mutate<TData = any, TVariables = Record<string, any>>(mutation: Mutation<TVariables>): Promise<GraphQLResponse<TData>>;
|
23 | }
|
24 | declare const _default: (server: ApolloServerBase) => ApolloServerTestClient;
|
25 | export default _default;
|
26 |
|
\ | No newline at end of file |