-1

I everyone,

I hope you are all safe, healthy, and happy in these scary times. I am working on an e-commerce website based on Next.js Prisma, Yoga, and GraphQL.

I am having trouble building a query to see if a Type field is true on an item in my DB and only show those sandwiches on the homepage.

On the frontend, I have tried:

const FEATURED_SANDWICH_QUERY = gql`
  query FEATURED_SANDWICH_QUERY {
    sandwiches(orderBy: featured_DESC) {
      id
      image
      title
      description
    }
  }
`;

and sandwiches(where: {featured_contains: true}) and sandwiches(where: {featured: true})

So far I am getting nothing returned or others errors

Here are the links to the backend query, data model, and schema. I am new at this, what am I doing wrong building the query? Thanks For your help

Query.js

datamodel.graphql

schema.graphql

Homepage.js

Tithos
  • 1,191
  • 4
  • 17
  • 40

1 Answers1

1

sandwiches(where: {featured: true}) should work as per your schema. Could you check again?

Ryan
  • 5,229
  • 1
  • 20
  • 31