# How to query tag in to getStaticPaths

**URL:** <https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [July 11, 2020, 7:31pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183 "2020-07-11T19:31:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbandit001](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/mbandit001/32/249_2.png) [@mbandit001](https://community.prismic.io/u/mbandit001)\
**Post date:** [July 11, 2020, 7:31pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/1 "2020-07-11T19:31:24Z")

</div>

I make tag manual it's still work but i don't want to make it manual. Can i query all tag and store in params ?

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/e921358bac0a64a6930ad7653f0022b62b7eadb9.png)

---

<div class="post-metadata">

**Author:** ![Levi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/levi/32/24_2.png) [@Levi](https://community.prismic.io/u/Levi)\
**Post date:** [July 13, 2020, 9:00am UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/2 "2020-07-13T09:00:11Z")

</div>

Hi @mbandit001, you can query all the tags in your repository by hitting the api endpoint of your repo:  
[https://your-repo-name.cdn.prismic.io/api/v2](https://your-repo-name.cdn.prismic.io/api/v2)

```auto
import Prismic from 'prismic-javascript';

...
const apiObject = await Prismic.api("http://your-repo-name.prismic.io/api/v2")
console.log(apiObject)

```

The results returned from that call will include a list of tags.

---

<div class="post-metadata">

**Author:** ![mbandit001](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/mbandit001/32/249_2.png) [@mbandit001](https://community.prismic.io/u/mbandit001)\
**Post date:** [July 13, 2020, 11:12am UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/3 "2020-07-13T11:12:29Z")

</div>

It’s work, But i have some problem. In my post have multi tag like “tag1”, “tag2” but render result is “tag1tag2” . How to fix it ?

---

<div class="post-metadata">

**Author:** ![Levi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/levi/32/24_2.png) [@Levi](https://community.prismic.io/u/Levi)\
**Post date:** [July 13, 2020, 1:16pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/4 "2020-07-13T13:16:22Z")

</div>

Can you show me how you’re rending the tags onto the page?

---

<div class="post-metadata">

**Author:** ![mbandit001](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/mbandit001/32/249_2.png) [@mbandit001](https://community.prismic.io/u/mbandit001)\
**Post date:** [July 13, 2020, 1:31pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/5 "2020-07-13T13:31:29Z")

</div>

In first post have 1 tag. And Fourth post have 2 tag.  
 ![one](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/b0fdc25ee8daefb421e0ca515b94225b83909a5c.png)

![two](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/791a9c36418611851a6ef2752cd24b36a999b31c.png)

---

<div class="post-metadata">

**Author:** ![Levi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/levi/32/24_2.png) [@Levi](https://community.prismic.io/u/Levi)\
**Post date:** [July 13, 2020, 1:41pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/6 "2020-07-13T13:41:12Z")

</div>

What is the code you’re using to render the tags?

---

<div class="post-metadata">

**Author:** ![mbandit001](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/mbandit001/32/249_2.png) [@mbandit001](https://community.prismic.io/u/mbandit001)\
**Post date:** [July 13, 2020, 1:56pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/7 "2020-07-13T13:56:28Z")

</div>

I use {(post.tags)} render tag.

![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/9708ae50ce5a7f5b3676d49760595456581fa2da.png)

![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/5f193b3a56f9dd43f807206394f6c6edb9baddb9.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/c6ae70ee34337a659e1515d417ff3ac292c3604a.png)

---

<div class="post-metadata">

**Author:** ![Levi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/levi/32/24_2.png) [@Levi](https://community.prismic.io/u/Levi)\
**Post date:** [July 13, 2020, 2:46pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/8 "2020-07-13T14:46:47Z")

</div>

Okay well you’ll likely need to loop over the tags array (or use the map) to render them as separate tags on the page.

Something like [this example](https://nextjs.org/docs/basic-features/pages#scenario-1-your-page-content-depends-on-external-data) from the Next.js docs.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [September 22, 2020, 10:58am UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/9 "2020-09-22T10:58:35Z")

</div>

closed on September 22, 2020, 10:58am UTC, flag & select 'Something Else' to reopen.

This issue has been closed due to inactivity.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:32pm UTC](https://community.prismic.io/t/how-to-query-tag-in-to-getstaticpaths/1183/10 "2021-12-09T17:32:20Z")

</div>

Opened on December 9, 2021, 5:32pm UTC


