@bitblit/ratchet-graphql 4.0.1-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { BuildInformation } from '@bitblit/ratchet-common';
2
+ export declare class RatchetGraphqlInfo {
3
+ private constructor();
4
+ static buildInformation(): BuildInformation;
5
+ }
@@ -0,0 +1,22 @@
1
+ import { GraphqlRatchetEndpointProvider } from './provider/graphql-ratchet-endpoint-provider.js';
2
+ import { GraphqlRatchetJwtTokenProvider } from './provider/graphql-ratchet-jwt-token-provider.js';
3
+ import { GraphqlRatchetQueryProvider } from './provider/graphql-ratchet-query-provider.js';
4
+ import { GraphqlRatchetErrorHandler } from './provider/graphql-ratchet-error-handler.js';
5
+ export declare class GraphqlRatchet {
6
+ private queryProvider;
7
+ private endpointProvider;
8
+ private jwtTokenProvider;
9
+ private errorHandler;
10
+ private apolloCache;
11
+ private noAuthApollo;
12
+ private cachedEndpoint;
13
+ constructor(queryProvider: GraphqlRatchetQueryProvider, endpointProvider: GraphqlRatchetEndpointProvider, jwtTokenProvider: GraphqlRatchetJwtTokenProvider, errorHandler?: GraphqlRatchetErrorHandler);
14
+ private fetchQueryAsGql;
15
+ private createAnonymousApi;
16
+ private fetchApi;
17
+ private createAuthApi;
18
+ private checkIfEndpointChanged;
19
+ clearCaches(): void;
20
+ executeQuery<T>(queryName: string, variables: Record<string, any>, runAnonymous?: boolean): Promise<T>;
21
+ executeMutate<T>(queryName: string, variables: any, runAnonymous?: boolean): Promise<T>;
22
+ }
@@ -0,0 +1,8 @@
1
+ import { GraphqlRatchetErrorHandler } from './graphql-ratchet-error-handler.js';
2
+ import { LoggerLevelName } from '@bitblit/ratchet-common';
3
+ export declare class DefaultGraphqlRatchetErrorHandler implements GraphqlRatchetErrorHandler {
4
+ private logLevel;
5
+ private rethrow;
6
+ constructor(logLevel?: LoggerLevelName, rethrow?: boolean);
7
+ handleError(error: any, queryName: string, variables: Record<string, any>, anonymous: boolean): void;
8
+ }
@@ -0,0 +1,3 @@
1
+ export interface GraphqlRatchetEndpointProvider {
2
+ fetchGraphqlEndpoint(): string;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface GraphqlRatchetErrorHandler {
2
+ handleError(error: any, queryName: string, variables: Record<string, any>, anonymous: boolean): void;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface GraphqlRatchetJwtTokenProvider {
2
+ fetchJwtToken(): string;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface GraphqlRatchetQueryProvider {
2
+ fetchQueryText(name: string): Promise<string>;
3
+ }
@@ -0,0 +1,8 @@
1
+ import { GraphqlRatchetQueryProvider } from './graphql-ratchet-query-provider.js';
2
+ export declare class LocalFetchQueryProvider implements GraphqlRatchetQueryProvider {
3
+ private pathTemplate;
4
+ private forcePathToLowerCase;
5
+ private cacheMap;
6
+ constructor(pathTemplate?: string, forcePathToLowerCase?: boolean);
7
+ fetchQueryText(qry: string): Promise<string>;
8
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from './build/ratchet-graphql-info.js';
2
+ export * from './graphql/graphql-ratchet.js';
3
+ export * from './graphql/provider/default-graphql-ratchet-error-handler.js';
4
+ export * from './graphql/provider/graphql-ratchet-endpoint-provider.js';
5
+ export * from './graphql/provider/graphql-ratchet-error-handler.js';
6
+ export * from './graphql/provider/graphql-ratchet-jwt-token-provider.js';
7
+ export * from './graphql/provider/graphql-ratchet-query-provider.js';
8
+ export * from './graphql/provider/local-fetch-query-provider.js';