@terabits/grapi
Version:
Grapi Schema Generator For GraphQL Server
37 lines (36 loc) • 1.33 kB
JavaScript
;
exports.__esModule = true;
var lodash_1 = require("../../lodash");
var AbstractSdlField = (function () {
function AbstractSdlField(_a) {
var typename = _a.typename, nonNull = _a.nonNull, list = _a.list, itemNonNull = _a.itemNonNull, directives = _a.directives;
this.typename = typename;
this.nonNull = (0, lodash_1.defaultTo)(nonNull, false);
this.list = (0, lodash_1.defaultTo)(list, false);
this.itemNonNull = (0, lodash_1.defaultTo)(itemNonNull, false);
this.directives = directives || {};
}
AbstractSdlField.prototype.isNonNull = function () {
return this.nonNull;
};
AbstractSdlField.prototype.isList = function () {
return this.list;
};
AbstractSdlField.prototype.isItemNonNull = function () {
return this.itemNonNull;
};
AbstractSdlField.prototype.getDescription = function () {
return this.description;
};
AbstractSdlField.prototype.getDirective = function (name) {
return this.directives[name];
};
AbstractSdlField.prototype.getDirectives = function () {
return this.directives;
};
AbstractSdlField.prototype.getTypeName = function () {
return this.typename;
};
return AbstractSdlField;
}());
exports["default"] = AbstractSdlField;