# Unsure on how to implement previews

**URL:** <https://community.prismic.io/t/unsure-on-how-to-implement-previews/4470>\
**Category:** Developing with Prismic\
**Tags:** graphql\
**Created:** [March 10, 2021, 9:07pm UTC](https://community.prismic.io/t/unsure-on-how-to-implement-previews/4470 "2021-03-10T21:07:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil.crawford](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@neil.crawford](https://community.prismic.io/u/neil.crawford)\
**Post date:** [March 10, 2021, 9:07pm UTC](https://community.prismic.io/t/unsure-on-how-to-implement-previews/4470/1 "2021-03-10T21:07:31Z")

</div>

I've followed this guide

> **[Next Steps with GraphQL](https://prismic.io/docs/technologies/next-steps-graphql)**
>
> Learn what are the next steps to follow for your GraphQL and Prismic project.

I'm trying to get previews to work in an Elixir and Phoenix stack using their liveview technology. I've successfully decoded the cookie with name `io.prismic.preview` and these are the bits of data I've got

```
{ 
   "_tracker" => "xyzxyzxyz",
   "repo-name.prismic.io" => %{
       "preview" => "https://repo-name.prismic.io/previews/xyzxyzxyz?websitePreviewId=xyzxyzxyz"
  }
}

```

From the documentation I've read on previews I should have a `prismic-ref` within this data. How this looks like it could be either of the tokens within the URL.

I've been using this URL for my graphql queries `https://my-repo.cdn.prismic.io/graphql?query=#{query}` and setting `Prismic-ref` with the ref that comes back from an info request.

I've tried using the tokens but neither work in returning data as I would expect. Any help would be much appreciated as I think I'm either daft or the documentation is out of date.

---

<div class="post-metadata">

**Author:** ![neil.crawford](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@neil.crawford](https://community.prismic.io/u/neil.crawford)\
**Post date:** [March 11, 2021, 8:13am UTC](https://community.prismic.io/t/unsure-on-how-to-implement-previews/4470/2 "2021-03-11T08:13:23Z")

</div>

Hah! Nothing like a good sleep to sort your brain out.

I went back and read the docs again this morning 😊 and I'm now just setting the cookie value as the ref without doing anything to it. It's now working. 🤷‍♂️

Thanks for being my 🦆 programmer.

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [March 11, 2021, 12:10pm UTC](https://community.prismic.io/t/unsure-on-how-to-implement-previews/4470/3 "2021-03-11T12:10:41Z")

</div>

Hey Neil,

Welcome to the community! Glad you worked this one out. Let us know if you need anything else.

---

<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:** [March 12, 2021, 12:31pm UTC](https://community.prismic.io/t/unsure-on-how-to-implement-previews/4470/5 "2021-03-12T12:31:25Z")

</div>

Threads close after a period of inactivity. [Flag this thread](https://community.prismic.io/t/re-open-a-thread/2175) to re-open it and continue the conversation.

---

<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, 3:14pm UTC](https://community.prismic.io/t/unsure-on-how-to-implement-previews/4470/6 "2021-12-09T15:14:22Z")

</div>


