INNER CODE UNIT · TypeScript
getGraphQLScalarFilterTypeFields
OS-Guild/graphql-to-mongodb · src/graphQLFilterType.ts:99
function getGraphQLScalarFilterTypeFields(scalarType: GraphQLLeafType, not: boolean): GraphQLInputFieldConfigMap {
const fields = {
EQ: { type: scalarType, description: '$eq' },
GT: { type: scalarType, description: '$gt' },
GTE: { type: scalarType, description: '$gte' },
IN: { type: new GraphQLList(scalarType), description: '$in' },
ALL: { type: new GraphQLList(scalarType), description: '$all' },
LT: { type: scalarType, description: '$lt' },
LTE: { type: scalarType, description: '$lte' },
NE: { type: scalarType, description: '$ne' },
NIN: { type: new GraphQLList(scalarType), description: '$nin' }
};
if (scalarType.name === 'String') enhanceWithRegexFields(fields);
if (!not) {
enhanceWithNotField(fields, scalarType);