Kyle Gammon
09/14/2022, 8:08 AMwhere
filter against a particular field matches or that field is empty/null. I've been using this pattern (this is a pseudo schema, but take it that the User
model being queried would have a field named tags
which is an Array of a Tag
model):
query SampleQuery($tagIds: [ID!]!) { users(where: { OR: [ { tags_every: { id_in: $tagIds } }, { tags_every: { id: null } } ] }) { id }
Which seemed to do the job in Prisma 1 but when migrating over to more recent versions the query can end up crashing the client. I was wondering if there was a more efficient way of doing this that may be able to avoid using this more complex pattern?