fix: #576, graphql where on hasMany relationship not working (#582)

This commit is contained in:
James Mikrut
2022-05-23 22:06:37 -04:00
committed by GitHub
parent 982b3f0582
commit 20d251fd5d
3 changed files with 2 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ import {
import formatName from '../utilities/formatName';
import withOperators from './withOperators';
import operators from './operators';
import fieldToSchemaMap from './fieldToSchemaMap';
import fieldToSchemaMap from './fieldToWhereInputSchemaMap';
// buildWhereInputType is similar to buildObjectType and operates
// on a field basis with a few distinct differences.

View File

@@ -169,12 +169,6 @@ const fieldToSchemaMap: (parentName: string) => any = (parentName: string) => ({
});
}
if (field.hasMany) {
return {
type: new GraphQLList(type),
};
}
return { type };
},
upload: (field: UploadField) => ({

View File

@@ -4,7 +4,7 @@ import {
fieldIsPresentationalOnly,
FieldWithSubFields,
} from '../../fields/config/types';
import fieldToSchemaMap from './fieldToSchemaMap';
import fieldToSchemaMap from './fieldToWhereInputSchemaMap';
const recursivelyBuildNestedPaths = (parentName: string, field: FieldWithSubFields & FieldAffectingData) => {
const nestedPaths = field.fields.reduce((nestedFields, nestedField) => {