AllPrismicArticles does not query anything

Hello Prismic Team!

I have been trying to query some data in my blog page which looks like this

but the query returned is empty as shown in the image above.
Here is a link to the github repro with latest changes GitHub - itolimaesther/gatsby-prismic

Please assist.

Hi Esther,

Thanks for reaching out.

Can you please share with me (in a private message if necessary) your repository name to try to reproduce the issue?

Looking forward to your reply,
Fares

Here is the github repro

Sorry, I meant the Prismic repo name!

Hey there @itolimaesther!

I did a test with your repository. There are two reasons why the query isn't returning anything:

  1. There are still no published documents on the repository. As soon as you publish the draft with the type 'Article' you'll be able to see it in your API response.
  2. The filtering option that you added to your query isn't correct. The eq operator retrieves documents that match the given data. You can search with fields that have text strings, like a Rich Text, UID or Key Text field. Look at this example:
query MyQuery {
  allPrismicArticles(filter: {data: {description: {text: {regex: "/Lorem ipsum/i"}}}}) {
    edges {
      node {
        data {
          description {
            richText
          }
        }
      }
    }
  }
}

This document is using the regex operator to find all the document where there's a "lorem impsum" string inside the content field.

Threads close after a period of inactivity. Flag this thread to re-open it and continue the conversation.