Prisma 1 Forum

Return all records if no match

I am struggling to find a way to create a where filter. I want to return all records if there is no match

query($id: ID!, $providerID: [ID!]) {
business(where: {id: $id}) {
      id
      name
      appointments(where: {provider: {id_in: $providerID}}) {
        id
        start
        end
        date
        color
        noteToCustomer
        sendReminder
      }
}
}

So the providerID can be an empty array or contain ids. I want if its an empty array to return all results. Is that somehow possible?

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.