@graphql-mesh/transform-rename
Version:
29 lines (28 loc) • 1.06 kB
text/typescript
import type { GraphQLSchema } from 'graphql';
import type { MeshTransform, YamlConfig } from '@graphql-mesh/types';
type RenameMapObject = Map<string | RegExp, string>;
declare class ArgsMap {
size: number;
entries: {
fromType: string | RegExp;
fromField: string | RegExp;
fromArg: string | RegExp;
toArg: string;
}[];
set(fromType: string | RegExp, fromField: string | RegExp, fromArg: string | RegExp, toArg: string): void;
get(fromType: string, fromField: string): RenameMapObject;
}
export default class BareRename implements MeshTransform {
noWrap: boolean;
typesMap: RenameMapObject;
typesThatCanRenameDefaults: (string | RegExp)[];
fieldsMap: Map<string, RenameMapObject>;
argsMap: ArgsMap;
constructor({ config }: {
config: YamlConfig.RenameTransform;
});
matchInMap(map: RenameMapObject, toMatch: string): string;
renameType(type: any): import("graphql").GraphQLObjectType<any, any>;
transformSchema(schema: GraphQLSchema): GraphQLSchema;
}
export {};