# How to fetch preview data for repeatable types using variables in NextJs

**URL:** <https://community.prismic.io/t/how-to-fetch-preview-data-for-repeatable-types-using-variables-in-nextjs/4742>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [March 30, 2021, 9:03am UTC](https://community.prismic.io/t/how-to-fetch-preview-data-for-repeatable-types-using-variables-in-nextjs/4742 "2021-03-30T09:03:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asifkarim073](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@asifkarim073](https://community.prismic.io/u/asifkarim073)\
**Post date:** [March 30, 2021, 9:03am UTC](https://community.prismic.io/t/how-to-fetch-preview-data-for-repeatable-types-using-variables-in-nextjs/4742/1 "2021-03-30T09:03:28Z")

</div>

How to fetch the preview data for repeatable types.what is variable in fetch api

async function fetchAPI(query, { previewData, variables } = {}) {  
const prismicAPI = await PrismicClient.getApi()  
const res = await fetch(  
`${GRAPHQL_API_URL}?query=${query}&variables=${JSON.stringify(variables)}`,  
{  
headers: {  
'Prismic-Ref': previewData?.ref || prismicAPI.masterRef.ref,  
'Content-Type': 'application/json',  
'Accept-Language': API\_LOCALE,  
Authorization: `Token ${API_TOKEN}`,  
},  
}  
)

---

<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:** [May 10, 2021, 6:44pm UTC](https://community.prismic.io/t/how-to-fetch-preview-data-for-repeatable-types-using-variables-in-nextjs/4742/3 "2021-05-10T18:44:23Z")

</div>

Hi Asif,

We have released [new documentation for Next.js](https://prismic.io/docs/technologies/previews-nextjs), and the way we fetch preview data has changed.

Please let us know if you need any other assistance,  
Fares.

---

<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:** [May 17, 2021, 4:58pm UTC](https://community.prismic.io/t/how-to-fetch-preview-data-for-repeatable-types-using-variables-in-nextjs/4742/5 "2021-05-17T16:58:01Z")

</div>

This issue has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<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, 4:52pm UTC](https://community.prismic.io/t/how-to-fetch-preview-data-for-repeatable-types-using-variables-in-nextjs/4742/6 "2021-12-09T16:52:45Z")

</div>


