t-graphql
Version:
typed GraphQL - end-to-end type-safe GraphQL for TypeScript. Think tRPC, but GraphQL
39 lines • 1.65 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnumType = void 0;
exports.enumType = enumType;
var EnumValueType_1 = require("./EnumValueType");
var NamedType_abstract_1 = require("./NamedType.abstract");
var EnumType = /** @class */ (function (_super) {
__extends(EnumType, _super);
function EnumType(typename, values) {
var _this = _super.call(this, typename) || this;
_this.values = values.map(function (value) { return new EnumValueType_1.EnumValueType(typename, value); });
return _this;
}
return EnumType;
}(NamedType_abstract_1.NamedType));
exports.EnumType = EnumType;
function enumType(typename) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
return new EnumType(typename, values);
}
//# sourceMappingURL=EnumType.js.map
;