mirror of
https://github.com/strapi/strapi.git
synced 2025-07-27 10:56:36 +00:00
18 lines
500 B
JavaScript
18 lines
500 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);
|
||
|
},
|
||
|
});
|