INNER CODE UNIT · TypeScript
GetOprExistsType
OS-Guild/graphql-to-mongodb · src/graphQLFilterType.ts:24
const GetOprExistsType = () => cache(typesCache, "OprExists", () => new GraphQLEnumType({
name: 'OprExists',
values: {
EXISTS: { value: "exists" },
NOT_EXISTS: { value: "not_exists" },
}
}));
export function getGraphQLFilterType(type: GraphQLFieldsType, ...excludedFields: string[]): GraphQLInputObjectType {
const filterTypeName = setSuffix(type.name, 'Type', 'FilterType');
return cache(typesCache, filterTypeName, () => new GraphQLInputObjectType({
name: filterTypeName,
fields: getOrAndFields(type, ...excludedFields)
}));
}
function getOrAndFields(type: GraphQLFieldsType, ...excludedFields: string[]): () => FieldMap<GraphQLInputType> {