@terabits/grapi
Version:
Grapi Schema Generator For GraphQL Server
81 lines (80 loc) • 3.2 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 __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
exports.__esModule = true;
exports.ObjectField = exports.EnumField = exports.CustomScalarField = exports.ScalarField = exports.SdlFieldType = void 0;
var interface_1 = require("./interface");
exports.SdlFieldType = interface_1.SdlFieldType;
var sdlField_1 = __importDefault(require("./sdlField"));
var ScalarField = (function (_super) {
__extends(ScalarField, _super);
function ScalarField() {
return _super !== null && _super.apply(this, arguments) || this;
}
ScalarField.prototype.getFieldType = function () {
return interface_1.SdlFieldType.SCALAR;
};
return ScalarField;
}(sdlField_1["default"]));
exports.ScalarField = ScalarField;
var CustomScalarField = (function (_super) {
__extends(CustomScalarField, _super);
function CustomScalarField() {
return _super !== null && _super.apply(this, arguments) || this;
}
CustomScalarField.prototype.getFieldType = function () {
return interface_1.SdlFieldType.CUSTOM_SCALAR;
};
return CustomScalarField;
}(sdlField_1["default"]));
exports.CustomScalarField = CustomScalarField;
var EnumField = (function (_super) {
__extends(EnumField, _super);
function EnumField() {
return _super !== null && _super.apply(this, arguments) || this;
}
EnumField.prototype.getFieldType = function () {
return interface_1.SdlFieldType.ENUM;
};
EnumField.prototype.setEnumType = function (enumTypeThunk) {
this.enumTypeThunk = enumTypeThunk;
};
EnumField.prototype.getEnumType = function () {
return this.enumTypeThunk();
};
return EnumField;
}(sdlField_1["default"]));
exports.EnumField = EnumField;
var ObjectField = (function (_super) {
__extends(ObjectField, _super);
function ObjectField() {
return _super !== null && _super.apply(this, arguments) || this;
}
ObjectField.prototype.getFieldType = function () {
return interface_1.SdlFieldType.OBJECT;
};
ObjectField.prototype.setObjectType = function (objectTypeThunk) {
this.objectTypeThunk = objectTypeThunk;
};
ObjectField.prototype.getObjectType = function () {
return this.objectTypeThunk();
};
return ObjectField;
}(sdlField_1["default"]));
exports.ObjectField = ObjectField;