diff --git a/src/collections/operations/find.js b/src/collections/operations/find.js index 85359c0777..3201ac8827 100644 --- a/src/collections/operations/find.js +++ b/src/collections/operations/find.js @@ -25,10 +25,15 @@ async function find(args) { const queryToBuild = {}; if (where) { + let and = []; + + if (Array.isArray(where.and)) and = where.and; + if (Array.isArray(where.AND)) and = where.AND; + queryToBuild.where = { ...where, and: [ - ...(Array.isArray(where.and) ? where.and : []), + ...and, ], }; } diff --git a/src/graphql/schema/buildWhereInputType.js b/src/graphql/schema/buildWhereInputType.js index f685e546d6..81bcc6f129 100644 --- a/src/graphql/schema/buildWhereInputType.js +++ b/src/graphql/schema/buildWhereInputType.js @@ -292,7 +292,7 @@ const buildWhereInputType = (name, fields, parentName) => { 'id', GraphQLString, parentName, - ['equals', 'not_equals'], + ['equals', 'not_equals', 'in', 'not_in'], ), };