-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft data not returning #799
Comments
Hm. Nothing has changed in this module. But it sounds like an issue with authentication? Maybe you are no longer providing your token when fetching data from sanity? Can you inspect the request in your browser? |
Thank you for getting back to me @danielroe, you are completely right I needed to add |
I don't know what might have changed here upstream with Sanity, but I don't think Sanity returns draft posts unless credentials are passed. Without setting Is there any chance that you were previously setting a token that bypassed the need to reuse existing credentials? |
Hi @danielroe, I am having a similar issue and hoping you can help. I have set my config to I have added the following to nuxt.config (I'm using nuxt 2)
And then I have added a sanity.js plugin with the following:
But I still can't preview the pages if I'm on an incognito window. Do you know what I'm missing? |
@EmilyYond Or if you need to 'guard' access to this token, you should probably keep it in |
Version
module: 0.9.1
nuxt: 2.15.5
Nuxt configuration
Reproduction
I have a 'preview mode' on my site for clients to see their drafts as they build them, which has been working for over a year, but my sanity client now isn't returning any draft data. It used to, but for whatever reason it no longer is?
If the document is published, then it returns correctly, but if unpublished nothing returns. This is the case on both complex and simple queries, so my test
*[_type == 'blog' && slug.current == 'test']
should return data, and does in the sanity vision tab, but doesn't in my nuxt application unless I publish this blog.Has something changed with the sanity end point? Do I need to update my queries or my client to replicate that?
I know I am using a deprecated version, but its a big job for me to upgrade all my sites to v3, and one I don't have time for at the moment.
The text was updated successfully, but these errors were encountered: