RenameRootFields.js 957 B

1234567891011121314151617181920
  1. Object.defineProperty(exports, "__esModule", { value: true });
  2. var schemaRecreation_1 = require("../stitching/schemaRecreation");
  3. var TransformRootFields_1 = require("./TransformRootFields");
  4. var RenameRootFields = /** @class */ (function () {
  5. function RenameRootFields(renamer) {
  6. var resolveType = schemaRecreation_1.createResolveType(function (name, type) { return type; });
  7. this.transformer = new TransformRootFields_1.default(function (operation, fieldName, field) {
  8. return {
  9. name: renamer(operation, fieldName, field),
  10. field: schemaRecreation_1.fieldToFieldConfig(field, resolveType, true),
  11. };
  12. });
  13. }
  14. RenameRootFields.prototype.transformSchema = function (originalSchema) {
  15. return this.transformer.transformSchema(originalSchema);
  16. };
  17. return RenameRootFields;
  18. }());
  19. exports.default = RenameRootFields;
  20. //# sourceMappingURL=RenameRootFields.js.map