UNPKG

@pothos/plugin-federation

Version:

A Pothos plugin for implementing apollo federation subGraphs

17 lines 1.22 kB
import { type InterfaceParam, type MaybePromise, ObjectRef, type SchemaTypes } from '@pothos/core'; import type { GraphQLResolveInfo } from 'graphql'; import type { ExternalEntityOptions, Selection, SelectionFromShape, selectionShapeKey } from './types'; export declare const providesMap: WeakMap<{}, string>; export declare class ExternalEntityRef<Types extends SchemaTypes, Shape extends object, Key extends Selection<object>> extends ObjectRef<Types, Shape> { kind: "Object"; builder: PothosSchemaTypes.SchemaBuilder<Types>; private key?; private resolveReference?; constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string, { key, resolveReference, }: { key?: Key | Key[]; resolveReference?: (parent: Key[typeof selectionShapeKey], context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<Shape | null | undefined>; }); implement<const Interfaces extends InterfaceParam<Types>[]>({ fields, externalFields, directives, ...options }: ExternalEntityOptions<Types, Shape, Interfaces>): this; provides<T extends object>(selection: SelectionFromShape<T>): ExternalEntityRef<Types, Shape & T, Key>; } //# sourceMappingURL=external-ref.d.ts.map