Skip to content

Commit

Permalink
fix: #576, graphql where on hasMany relationship not working (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut authored May 24, 2022
1 parent 982b3f0 commit 20d251f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/graphql/schema/buildWhereInputType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ const fieldToSchemaMap: (parentName: string) => any = (parentName: string) => ({
});
}

if (field.hasMany) {
return {
type: new GraphQLList(type),
};
}

return { type };
},
upload: (field: UploadField) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/schema/recursivelyBuildNestedPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 20d251f

Please sign in to comment.