@jokio/graphql
Version:
High level, pre-configured, GraphQL Server
47 lines (46 loc) • 1.43 kB
TypeScript
import { ApolloLink, RequestHandler, Operation } from 'apollo-link';
export declare namespace HttpLink {
/**
* A function that generates the URI to use when fetching a particular operation.
*/
interface UriFunction {
(operation: Operation): string;
}
interface Options {
/**
* The URI to use when fetching operations.
*
* Defaults to '/graphql'.
*/
uri?: string | UriFunction;
/**
* Passes the extensions field to your graphql server.
*
* Defaults to false.
*/
includeExtensions?: boolean;
/**
* A `fetch`-compatible API to use when making requests.
*/
fetch?: any;
/**
* An object representing values to be sent as headers on the request.
*/
headers?: any;
/**
* The credentials policy you want to use for the fetch call.
*/
credentials?: string;
/**
* Any overrides of the fetch options argument to pass to the fetch call.
*/
fetchOptions?: any;
}
}
export import FetchOptions = HttpLink.Options;
export import UriFunction = HttpLink.UriFunction;
export declare const createHttpLink: (linkOptions?: FetchOptions) => ApolloLink;
export declare class HttpLink extends ApolloLink {
requester: RequestHandler;
constructor(opts?: HttpLink.Options);
}