mirror of
https://github.com/strapi/strapi.git
synced 2025-07-27 19:10:01 +00:00
18 lines
502 B
JavaScript
18 lines
502 B
JavaScript
'use strict';
|
|
|
|
const { get, map, mapValues } = require('lodash/fp');
|
|
|
|
module.exports = ({ strapi }) => ({
|
|
graphqlScalarToOperators(graphqlScalar) {
|
|
const { GRAPHQL_SCALAR_OPERATORS } = strapi.plugin('graphql').service('constants');
|
|
const { operators } = strapi.plugin('graphql').service('builders').filters;
|
|
|
|
const associations = mapValues(
|
|
map((operatorName) => operators[operatorName]),
|
|
GRAPHQL_SCALAR_OPERATORS
|
|
);
|
|
|
|
return get(graphqlScalar, associations);
|
|
},
|
|
});
|