@zuu/owl
Version:
Zuu's Experimental GraphQL Implementation
34 lines • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const getMetadataStorage_1 = require("../metadata/getMetadataStorage");
const findType_1 = require("../helpers/findType");
const errors_1 = require("../errors");
function Root(propertyName) {
return (prototype, propertyKey, parameterIndex) => {
if (typeof propertyKey === "symbol") {
throw new errors_1.SymbolKeysNotSupportedError();
}
let getType;
try {
const typeInfo = findType_1.findType({
metadataKey: "design:paramtypes",
prototype,
propertyKey,
parameterIndex,
});
getType = typeInfo.getType;
}
catch (_a) {
}
getMetadataStorage_1.getMetadataStorage().collectHandlerParamMetadata({
kind: "root",
target: prototype.constructor,
methodName: propertyKey,
index: parameterIndex,
propertyName,
getType,
});
};
}
exports.Root = Root;
//# sourceMappingURL=Root.js.map