UNPKG

@graphql-codegen/near-operation-file-preset

Version:

GraphQL Code Generator preset for generating operation code near the operation file

22 lines (21 loc) 1.07 kB
import { DocumentNode, FragmentDefinitionNode, GraphQLSchema } from 'graphql'; import { FragmentRegistry } from './fragment-resolver.cjs'; export declare function defineFilepathSubfolder(baseFilePath: string, folder: string): string; export declare function appendFileNameToFilePath(baseFilePath: string, fileName: string, extension: string): string; /** * Analyzes fragment usage in a GraphQL document. * Returns information about which fragments are used and which specific types they're used with. */ export declare function analyzeFragmentUsage(documentNode: DocumentNode, fragmentRegistry: FragmentRegistry, schema: GraphQLSchema): { fragmentsInUse: { [fragmentName: string]: number; }; usedFragmentTypes: { [fragmentName: string]: string[]; }; }; export declare function extractExternalFragmentsInUse(documentNode: DocumentNode | FragmentDefinitionNode, fragmentNameToFile: FragmentRegistry, localFragment: Set<string>, result?: { [fragmentName: string]: number; }, level?: number): { [fragmentName: string]: number; };