"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFieldsQueryParam = getFieldsQueryParam;
const getTopLevelPredicate_1 = require("../commonHelpers/getTopLevelPredicate");
/**
 * @private
 * Extracts the fields value that the search should be filtered by.
 * Also validates that the fields predicate is not combined in some
 * invalid way with other predicates.
 *
 * @param query query to extract the fields predicate from
 * @returns the fields value to filter by
 */
function getFieldsQueryParam(query) {
    const fieldsPredicate = (0, getTopLevelPredicate_1.getTopLevelPredicate)("fields", query.filters);
    return fieldsPredicate === null || fieldsPredicate === void 0 ? void 0 : fieldsPredicate.fields;
}
//# sourceMappingURL=getFieldsQueryParam.js.map