UNPKG

@graphql-mesh/fusion-composition

Version:

Basic composition utility for Fusion spec

30 lines (29 loc) 1.46 kB
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase } from 'change-case'; import type { SubgraphTransform } from '../compose.js'; export type NameReplacer = (name: string) => string; export type NamingConventionType = keyof typeof NamingConventionMap; export declare const NamingConventionMap: { readonly camelCase: typeof camelCase; readonly capitalCase: typeof capitalCase; readonly constantCase: typeof constantCase; readonly dotCase: typeof dotCase; readonly headerCase: typeof headerCase; readonly noCase: typeof noCase; readonly paramCase: typeof paramCase; readonly pascalCase: typeof pascalCase; readonly pathCase: typeof pathCase; readonly sentenceCase: typeof sentenceCase; readonly snakeCase: typeof snakeCase; readonly upperCase: typeof upperCase; readonly lowerCase: typeof lowerCase; }; export interface NamingConventionTransform { typeNames?: NamingConventionType | NameReplacer; fieldNames?: NamingConventionType | NameReplacer; enumValues?: NamingConventionType | NameReplacer; fieldArgumentNames?: NamingConventionType | NameReplacer; } export declare function createNamingConventionTransform(config: NamingConventionTransform): SubgraphTransform; export * from 'change-case'; export declare function upperCase(str: string): string; export declare function lowerCase(str: string): string;