UNPKG

@graphql-yoga/apollo-managed-federation

Version:

This plugin integrates Apollo Managed Federation into Yoga.

15 lines (14 loc) 878 B
import { type Plugin } from 'graphql-yoga'; import { FetchError, SupergraphSchemaManager, type SupergraphSchemaManagerOptions } from '@graphql-tools/federation'; export type ManagedFederationPluginOptions = (SupergraphSchemaManager | SupergraphSchemaManagerOptions) & { /** * Allow to customize how a schema loading failure is handled. * A failure happens when the manager failed to load the schema more than the provided max retries * count. * By default, an error is logged and the polling is restarted. * @param error The error encountered during the last fetch tentative * @param delayInSeconds The delay in seconds indicated by GraphOS before a new try */ onFailure?: (error: FetchError | unknown, delayInSeconds: number) => void; }; export declare function useManagedFederation(options?: ManagedFederationPluginOptions): Plugin;