UNPKG

800 BTypeScriptView Raw
1import type { ASTNode, DirectiveNode, GraphQLSchema } from 'graphql';
2export type DirectableASTNode = ASTNode & {
3 directives?: readonly DirectiveNode[] | undefined;
4};
5export type DirectableObject = {
6 astNode?: DirectableASTNode | null | undefined;
7 extensionASTNodes?: readonly DirectableASTNode[] | null | undefined;
8 extensions?: {
9 directives?: Record<string, any> | undefined;
10 } | null | undefined;
11};
12export declare function getDirectiveExtensions<TDirectiveAnnotationsMap extends {
13 [directiveName: string]: {
14 [paramName: string]: any;
15 };
16}>(directableObj: DirectableObject, schema?: GraphQLSchema, pathToDirectivesInExtensions?: string[]): { [directiveName in keyof TDirectiveAnnotationsMap]?: TDirectiveAnnotationsMap[directiveName][] | undefined; };