@graphql-mesh/transport-rest
Version:
19 lines (18 loc) • 536 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.processDictionaryDirective = processDictionaryDirective;
function processDictionaryDirective(fieldMap, field) {
field.resolve = function dictionaryDirectiveHandler(root) {
const result = [];
for (const key in root) {
if (key in fieldMap) {
continue;
}
result.push({
key,
value: root[key],
});
}
return result;
};
}
;