UNPKG

@bitblit/ratchet-graphql

Version:

Ratchet tools to simplify use of graphql

26 lines (25 loc) 1.38 kB
import { GraphqlRatchetEndpointProvider } from './provider/graphql-ratchet-endpoint-provider.js'; import { GraphqlRatchetJwtTokenProvider } from './provider/graphql-ratchet-jwt-token-provider.js'; import { GraphqlRatchetQueryProvider } from './provider/graphql-ratchet-query-provider.js'; import { GraphqlRatchetErrorHandler } from './provider/graphql-ratchet-error-handler.js'; import { AuthorizationStyle } from './authorization-style.js'; export declare class GraphqlRatchet { private queryProvider; private endpointProvider; private jwtTokenProvider?; private errorHandler; private clientCache; private noAuthClient; private cachedEndpoint; constructor(queryProvider: GraphqlRatchetQueryProvider, endpointProvider: GraphqlRatchetEndpointProvider, jwtTokenProvider?: GraphqlRatchetJwtTokenProvider, errorHandler?: GraphqlRatchetErrorHandler); currentAuthToken(): string; fetchQueryText(qry: string): Promise<string>; private createAnonymousApi; private fetchApi; private createAuthApi; private checkIfEndpointChanged; clearCaches(): void; static extractSingleValueFromResponse<T>(data: any): T; executeQuery<T>(queryName: string, variables: Record<string, any>, authStyle?: AuthorizationStyle): Promise<T>; executeMutate<T>(queryName: string, variables: any, authStyle?: AuthorizationStyle): Promise<T>; }