Hey all! I'm new to prisma. I am getting an error ...
# orm-help
v
Hey all! I'm new to prisma. I am getting an error on
Copy code
const data = await context.prisma.analytics({
      where: {ipUrl_contains: args.filter }
  })
. Is there an issue with how i wrote where filter?
a
Hi. What error do you receive? At first glance, your resolver seems fine, but check it in your Prisma service's playground (by default localhost:4466).
v
My query is: query{ analyticsIp( filter:"adv" ){ id } }
I got the following error: message": "Variable '$where' expected value of type 'AnalyticsWhereUniqueInput!' but got: {\"where\":{\"OR\":[{\"clickCount_contains\":\"adv\"},{\"ipUrl_contains\":\"adv\"}]}}. Reason: 'where' Field 'where' is not defined in the input type 'AnalyticsWhereUniqueInput'. (line 1, column 8):\nquery ($where: AnalyticsWhereUniqueInput!) {\n ^"
I really appreciate your help
n
Copy code
const data = await context.prisma.analytics({ ipUrl_contains: args.filter })
Could you try this?
a
Hi! Did you check the 'Docs' section from your prisma service? Inside 'Docs' try to find 'analytics' query and here it shows you exactly how to write this query. If you don't find it, means that you have to check your prisma models, because something is wrong with your models.