Query all posts where a repeatable group contains a certain value

Hi there!

I need to make a query but don’t know how to write it.

Basically I have a Blog Post content type. One of the fields of the blog post is a group field called with an id “tags”, where you can add multiple relationship fields with an id “tag”, which is another content type called Blog Tag

Basically I need to query all Blog Post’s that is linked to this Blog Tag

Oh, and I’m using gatsby-source-prismic-graphql on Gatsby

I’d really appreciate some help on this

Hello @kaue and welcome to the Prismic community forum!

Prismic has a default tagging system built into the writing room, you can use it while editing your documents. Is there any reason you didn’t choose to use it?

Afterwards, you’d just need to query by tags

Let me know your thoughts on this option!

Hi @paulina.gavilan

Unfortunately the default tagging system is not powerful enough, there are a lot of issues with it.
The two main ones for us is that it’s just a string, there’s no way to add extra data to a tag and the second and biggest one is that tags are shared across all content types. So if there are 10 content types, each having 6 tags, then the marketing team will have to browse through 60 tags when they should be able to see just the ones that are relevant to the content type they are creating

I believe it was because of the limitations of the tag system that this article was published:

@kaue I totally understand that this may not be ideal for all cases. I’m going to tag the @features-team in this thread to let them know about this and we will add this to our feature request tracker as a possible improvement for the future.

@paulina.gavilan so my only choice is to use the default tagging system? Is there really no way query filtering by fields from a repeatable group?

@kaue, that is correct. As explained in this article, query by groups or Slices is not yet a possibility in Gatsby/GraphQL.

If you used the REST API for your calls this will be possible: Read the [REST API] documentation(https://prismic.io/docs/rest-api/query-the-api/search-parameters-reference) to learn more.

Both technologies have their individual benefits.