Prismic GQL query where

Im trying to query using where via graphql. I manually setup a blog within the date range. However the home which is a document link cause the query return nothing. can someone from support team help.

{
allBlogs(where: {date_after: “2020-01-01”, date_before: “2020-12-31”, home: “”}) {
edges {
node {
slug
}
}
}
}

1 Like

Hi @feng.cheng, can you show us the full GraphQL query that you’re running? And can you send a link to this query in your GraphQL API so that we can take a look?

Hi Levi,

https://kaplaneducators.prismic.io &

  allBlogs(where: {date_after: "2020-01-01", date_before: "2020-12-31", home: "Xs_Y3hAAACMAKD6L"}) {
    edges {
      node {
        slug
        publisher {
          ... on Publisher {
            slug
          }
        }
      }
    }
  }
}

@feng.cheng I took a look and found that the issue here is that your date isn’t within the range you’ve set. I don’t know if it was an accident, but the date field for this document is in 2010 which is why it isn’t appearing in the results. When I changed the date range to 2010, the document appears. Here is the working query.

ah got it. thank you for the quick reply