when I do a `where` clause with multiple inputs do...
# orm-help
v
when I do a
where
clause with multiple inputs do I have to surround them with an
AND
or is it implicit?
d
Are you using Prisma client or Prisma binding or GraphQL directly? πŸ™‚
v
prisma binding
d
You have to wrap it in
AND
. Please search for
export interface UserWhereInput
here: https://www.prisma.io/docs/1.15/use-prisma-api/prisma-bindings/code-generation-frr1/ And you will see TS typings for prisma-binding. JS follows the same API πŸ™‚
v
thanks!
Followup. Doesn this mean that
Copy code
const alreadyBooked = await ctx.db.bookings({
      where: {
        startDate_gte: args.checkIn,
        startDate_lte: args.checkOut,
        place: { id: args.placeId },
      },
    })
these all would have to be wrapped in an
AND
?
(taken form the airbnb clone example)
d
Interesting, let me get back to you after trying it out πŸ™‚
p
from my experience, it’s an implicit
AND
if you provide multiple conditions