How can I search in a rich text field inside a dynamic zone with graphql?

System Information
  • Strapi Version: v3.6.0
  • Operating System: macOS
  • Database: Mysql
  • Node Version: v14.17.3
  • NPM Version: 7.19.0
  • Yarn Version: /

I would like to be able to implement a search function on my website of articles. I want to search the titles but also the content of the article. That content is a rich text field and I’m not really sure how to implement the filter in the graphql request.

This is an example of an article i get in a request without any filters:

This is how I search the title:

const query = this.$gql`
  query Articles {
    articles ( start: 0, limit: 6, locale: "${this.$i18n.locale}", sort: "created_at:desc", where:{ title_contains:"${searchString}" } ){
      ${this.fields}
    }
  }
`
const articles = await this.$graphql.default.request(query)

That works fine but i’m not sure how to write the filter to search the content property inside the body because it’s a dynamic zone. Is it even possible?

In the v3 you can’t do any kind of filtering on components. This is something we are adding in the v4