UNPKG

@graphql-mesh/transport-rest

Version:
20 lines (19 loc) 581 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.processDictionaryDirective = void 0; 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; }; } exports.processDictionaryDirective = processDictionaryDirective;