UNPKG

@aws-amplify/graphql-transformer-core

Version:

A framework to transform from GraphQL SDL to AWS CloudFormation.

20 lines 858 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TransformerSchemaHelper = void 0; class TransformerSchemaHelper { constructor() { this.typeMap = new Map(); this.setTypeMapping = (newTypeName, originalTypeName) => { if (this.typeMap.has(newTypeName)) { throw new Error(`Type ${newTypeName} has already been mapped to ${this.typeMap.get(newTypeName)}, and cannot be mapped to ${originalTypeName}`); } this.typeMap.set(newTypeName, originalTypeName); }; this.getTypeMapping = (newTypeName) => { var _a; return (_a = this.typeMap.get(newTypeName)) !== null && _a !== void 0 ? _a : newTypeName; }; } } exports.TransformerSchemaHelper = TransformerSchemaHelper; //# sourceMappingURL=schema-helper.js.map