@pothos/plugin-federation
Version:
A Pothos plugin for implementing apollo federation subGraphs
24 lines (23 loc) • 1.22 kB
TypeScript
import type { SchemaTypes } from '@pothos/core';
import type { GraphQLResolveInfo } from 'graphql';
import type { KeyDirective, Selection } from './types.js';
type DirectiveList = {
name: string;
args?: object;
}[];
type DirectiveOption = DirectiveList | Record<string, object>;
export declare function keyDirective(key: KeyDirective<object> | KeyDirective<object>[]): {
name: string;
args?: object;
}[];
export declare function mergeDirectives(existing: DirectiveOption | undefined, add: DirectiveList): DirectiveList;
export declare const entityMapping: WeakMap<PothosSchemaTypes.SchemaBuilder<any>, Map<string, {
key: Selection<object> | Selection<object>[];
interfaceObject?: boolean;
resolveReference?: (val: object, context: {}, info: GraphQLResolveInfo) => unknown;
}>>;
export declare const usedDirectives: Map<PothosSchemaTypes.SchemaBuilder<any>, Set<string>>;
export declare function getUsedDirectives<Types extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<Types>): string[];
export declare function addUsedDirectives<Types extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<Types>, directives: string[]): void;
export {};
//# sourceMappingURL=util.d.ts.map