UNPKG

@graphql-hive/apollo

Version:
50 lines 1.78 kB
import type { ApolloServerPlugin } from '@apollo/server'; import { HiveClient, HivePluginOptions, type CircuitBreakerConfiguration } from '@graphql-hive/core'; import { Logger } from '@graphql-hive/logger'; export { atLeastOnceSampler, createSchemaFetcher, createServicesFetcher, createSupergraphSDLFetcher, } from '@graphql-hive/core'; /** @deprecated Use {CreateSupergraphManagerArgs} instead */ export type { SupergraphSDLFetcherOptions } from '@graphql-hive/core'; /** * Configuration for {createSupergraphManager}. */ export type CreateSupergraphManagerArgs = { /** * The artifact endpoint to poll. * E.g. `https://cdn.graphql-hive.com/<uuid>/supergraph` */ endpoint: string | [string, string]; /** * The CDN access key for fetching artifact. */ key: string; logger?: Logger; /** * The supergraph poll interval in milliseconds * Default: 30_000 */ pollIntervalInMs?: number; /** Circuit breaker configuration override. */ circuitBreaker?: CircuitBreakerConfiguration; fetchImplementation?: typeof fetch; /** * Client name override * Default: `@graphql-hive/apollo` */ name?: string; /** * Client version override * Default: currents package version */ version?: string; }; export declare function createSupergraphManager(args: CreateSupergraphManagerArgs): { initialize(hooks: { update(supergraphSdl: string): void; }): Promise<{ supergraphSdl: string; cleanup?: () => Promise<void>; }>; }; export declare function createHive(clientOrOptions: HivePluginOptions): HiveClient; export declare function useHive(clientOrOptions: HiveClient | HivePluginOptions): ApolloServerPlugin; //# sourceMappingURL=index.d.ts.map