Question
Answer
To filter by not null, you can wrap the field in `not: {}` like `{ where: { not: { endedAt: null } }`. To filter by null specifically, you can use `{ where: { endedAt: null } }`. If you are using `prisma-binding`, you can call `db.post.findMany({where:{category: {not: null}}})`.
Shehab
04/28/2020, 12:46 AMAlex Vilchis
04/28/2020, 1:17 AMnot: {}
Oliver Evans
04/28/2020, 1:21 AMdb.post.findMany({where:{category: {not: null}}})
Shehab
04/28/2020, 1:37 AMJoseph
04/28/2020, 5:59 AMfindMany
function coming from?const existingMatches = await prisma.query.matches(
{
where: { endedAt: { not: null } },
},
info,
)
This throws an error:
GraphQL error: Variable '$_v0_where' expected value of type 'MatchWhereInput' but got: {"endedAt":{"not":null}}. Reason: 'endedAt' Date value expected
Anton Pokhylenko
04/28/2020, 6:09 AM{ where: { not: { endedAt: null } }
Joseph
04/28/2020, 6:14 AMNOT: []
if I needed where it's not null. My issue is I can't filter by null
at allprisma
from prisma-binding
, passed in through the context in the resolver. Perhaps the issue is that I'm not using db
, but i'm also not sure where that's coming fromRyan
04/28/2020, 11:11 AMJoseph
04/28/2020, 3:49 PM