@graphql-codegen/near-operation-file-preset
Version:
GraphQL Code Generator preset for generating operation code near the operation file
18 lines (17 loc) • 800 B
TypeScript
import { DocumentNode, GraphQLSchema } from 'graphql';
import { FragmentRegistry } from './fragment-resolver.js';
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[];
};
operationFragments: Set<string>;
};