graphql-friendly
Version:
An easy and friendly graphql client, alternative to apollo-client
33 lines (28 loc) • 867 B
TypeScript
import * as graphql_ws from 'graphql-ws';
import { AxiosPromise } from 'axios';
declare class GraphqlClient$1 {
private url;
private headers;
private subscriptionClient;
constructor(url: string, headers: Record<string, string>);
query(args: any, { headers }?: {
headers: any;
}): AxiosPromise<any>;
mutation({ query, variables }: {
query: any;
variables: any;
}, opts: any): AxiosPromise<any>;
subscribe<A, B>({ query, variables }: {
query: any;
variables: any;
}): AsyncIterableIterator<graphql_ws.FormattedExecutionResult<A, B>>;
}
interface IOptions {
url: string;
headers: any;
}
declare const _default: {
install: (app: any, options: IOptions) => void;
};
declare const GraphqlClient: typeof GraphqlClient$1;
export { GraphqlClient, IOptions, _default as default };