UNPKG

@boostercloud/application-tester

Version:

Contains Booster types related to the information extracted from the user project

25 lines (24 loc) 1.14 kB
import { ApolloClient, ApolloClientOptions, NormalizedCacheObject } from '@apollo/client'; import { SubscriptionClient } from 'subscriptions-transport-ws'; import { ProviderTestHelper } from './provider-test-helper'; type AuthToken = string | (() => string); export declare class GraphQLHelper { private providerTestHelper; constructor(providerTestHelper: ProviderTestHelper); client(authToken?: AuthToken): ApolloClient<NormalizedCacheObject>; /** * IMPORTANT: After using this "DisconnectableApolloClient", you must call ".disconnect()" to close the socket. Otherwise * it will keep waiting for messages forever */ clientWithSubscriptions(authToken?: AuthToken): Promise<DisconnectableApolloClient>; private getApolloHTTPLink; private getAuthLink; private subscriptionsClient; } export declare class DisconnectableApolloClient extends ApolloClient<NormalizedCacheObject> { private readonly subscriptionClient; constructor(subscriptionClient: SubscriptionClient, options: ApolloClientOptions<NormalizedCacheObject>); reconnect(): Promise<void>; disconnect(): void; } export {};