INNER CODE UNIT · TypeScript

enhanceWithRegexFields

OS-Guild/graphql-to-mongodb · src/graphQLFilterType.ts:126

function enhanceWithRegexFields(fields: GraphQLInputFieldConfigMap): void {
    fields.REGEX = { type: GraphQLString, description: '$regex' };
    fields.OPTIONS = { type: GraphQLString, description: '$options. Modifiers for the $regex expression. Field is ignored on its own' };
}

function enhanceWithNotField(fields: GraphQLInputFieldConfigMap, scalarType: GraphQLScalarType | GraphQLEnumType): void {
    fields.NOT = { type: getGraphQLLeafFilterType(scalarType, true), description: '$not' };
}

function warnOfIndependentResolveFields(type: GraphQLFieldsType): void {
    cache(warnedIndependentResolvers, type.toString(), () => {
        const fields =
            getTypeFields(type, (key, field) =>
                field.resolve && !Array.isArray(field.dependencies))();

        Object.keys(fields).forEach(key =>
            warn(`Field ${key} of type ${type} has a resolve function and no dependencies`));

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…