UNPKG

graphql-compose-elasticsearch

Version:
35 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRegexpITC = void 0; const utils_1 = require("../../../utils"); const FieldNames_1 = require("../../Commons/FieldNames"); function getRegexpITC(opts) { const name = (0, utils_1.getTypeName)('QueryRegexp', opts); const description = (0, utils_1.desc)(` The regexp query allows you to use regular expression term queries. [Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html) `); const subName = (0, utils_1.getTypeName)('QueryRegexpSettings', opts); const fields = (0, FieldNames_1.getStringAsFieldConfigMap)(opts, opts.getOrCreateITC(subName, () => ({ name: subName, fields: { value: 'String!', boost: 'Float', flags: 'String', max_determinized_states: 'Int', }, }))); if (typeof fields === 'object') { return opts.getOrCreateITC(name, () => ({ name, description, fields, })); } return { type: 'JSON', description, }; } exports.getRegexpITC = getRegexpITC; //# sourceMappingURL=Regexp.js.map