DEV Community

Discussion on: How to handle content previews from Sanity in Nuxt

Collapse
 
mornir profile image
Jérôme Pott

Hey! I'm glad to know that my article was useful for you.
Maybe it's necessary to order the documents to be sure to get the draft first, like this:

this.$sanity.listen('*[_type == "movie" && slug.current == $slug][0] | order(_updatedAt desc)[0]'
Enter fullscreen mode Exit fullscreen mode

Like I mentioned in my post, I'm not really convinced by this approach for real-time live preview. The team at Sanity recently released a better real-time preview mode for Next.js which uses the @sanity/groq-store package under hood.
Hoping that next year we can get a similar library for Nuxt.