Hello I'm following the course in <howtographql.co...
# orm-help
g
Hello I'm following the course in howtographql.com on graphql and node and in the following code fragment, I get OR is not defined:
Copy code
async function feed(parent, args, context, info) {
  const where = args.filter ? {
    OR: [
      { description_contains: args.filter },
      { url_contains: args.filter },
    ],
  } : {}

  const links = await context.prisma.links({
    where
  })
  return links
}
So I checked the generated prisma.schema.js and indeed it wasn't defined in LinkWhereInput I don't know if this has happened to other people or if there's actually a problem with my setup.
s
Hey! the query you’ve written looks correct to me. It would become invalid when
args.filter
is falsy though. Could you log out the args before returning the links and see what you get?
g
@siddhant Hello, thanks for the reply, in the query I filtered with "in" and that's indeed what was logged in the console in any case here's the message I got in the playground
Copy code
Variable '$where' expected value of type 'LinkWhereInput' but got: {\"OR\":[{\"description_contains\":\"in\"},{\"url_contains\":\"in\"}]}. Reason: 'OR' Field 'OR' is not defined in the input type 'LinkWhereInput'. (line 1, column 8):\nquery ($where: LinkWhereInput) {\n       ^