Content Relationship (Categories for a blog)

I have created a content type "Journal Category" to be a content relationship for my "Journal" custom type but when I try to display the categories I get undefined is not a function (near '...e.reduce...').

I am using this v-for to display the categories.

<ul>
        <li v-for="categorySingle in post.data.categoriesGroup" :key="categorySingle.id">
          <prismic-rich-text :field="categorySingle.category" :htmlSerializer="HtmlSerializer" />
        </li>
 </ul>

Where am I going wrong?

Hello @anthony.d.colli

Thank you for reaching out to us.

The way you pass a Content Relationship field into the Rich Text component won't work.

There are three steps for getting a Content Relationship field on the front end.

  1. Adding the Content Relationship field into a Custom Type in Prismic. (You are already doing this).
  2. To pull in content from another content, you need to modify your API query using the graphQuery or fetchLinks option. Please follow the link here.
  3. Once you have adjusted your API query, the linked content will appear in a "data" object nested in the Link or Content Relationship field where you can then template the field.

Now, If I understood by looking at your code, you have multiple Content Relationships/categories in your Custom Type, and you want to retrieve all of these on the front end. Would you please elaborate on this part to suggest you more options?

Thanks,
Priyanka