UNPKG

@graphql-tools/federation

Version:

Useful tools to create and manipulate GraphQL schemas.

20 lines (19 loc) 1.19 kB
import { GraphQLSchema, SelectionSetNode, TypeNode } from 'graphql'; export declare function getArgsFromKeysForFederation(representations: readonly any[]): { representations: readonly any[]; }; export declare function getKeyForFederation<TRoot>(root: TRoot): TRoot; export declare function projectDataSelectionSet(data: any, selectionSet?: SelectionSetNode): any; export declare function getKeyFnForFederation(typeName: string, keys: string[]): (root: any) => any; export declare function getCacheKeyFnFromKey(key: string): (root: any) => any; export declare function filterInternalFieldsAndTypes(finalSchema: GraphQLSchema): GraphQLSchema; export declare function getNamedTypeNode(typeNode: TypeNode): import("graphql").NamedTypeNode; type EventMap<T> = Record<keyof T, any[]>; export declare class EventEmitter<T extends EventMap<T>> { #private; on<K extends keyof T>(eventName: K, listener: (...args: T[K]) => void): this; once<K extends keyof T>(eventName: K, listener: (...args: T[K]) => void): this; off<K extends keyof T>(eventName: K, listener: (...args: T[K]) => void): this; emit<K extends keyof T>(eventName: K, ...args: T[K]): boolean; } export {};