Draft Mode & Revalidation #55692
Unanswered
adrocodes
asked this question in
App Router
Replies: 1 comment
-
|
@adrocodes hi, did you get any workaround / solution ? i have the same problem |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a client project and we're having some issues with
draftModenot pulling in the latest content. I feel like it was working fine until recently, maybe before the new13.5.xreleases.I haven't worked on a replication repo which is why I don't have a issue, I am hoping someone has run into a similar issue and has a fix or suggestion.
I have a page that is similar to this;
In this case
getClientwill return aApolloClientinstance andisPreview()essentially wrapsdraftMode().isEnabled. TheApolloClientinstance will change based on theisPreview()value. We're using Dato so we're adding the required headers.I've added
fetchPolicy: isPreview() ? 'no-cache' : undefinedto thequeryoptions and that seemed to work (until recently).I also changed my
getClientmethod to just return afetchwrapper similar to what Dato outlines in their docs. That also didn't make a difference.I don't really want to use the experimental apollo package for app directory, but since
fetchalso didn't work, I can't imagine it would make a huge difference.From Dato CMS there is a Preview Link which runs the
draftMode().enable()and then redirects to the page.I'd expect when I jump into
draftModethat the page would pull in the latest content, but it doesn't. To get the preview to show the latest content I either need to run arevalidatePathany time there is a draft change or rebuild the entire site which obviously isn't ideal.In my mind, I want this page to be built at deploy time and revalidate every 12 hours. When I jump into
draftModethe revalidate time should be ignored and the page should pull in the latest content on every refresh.Keen to hear if anyone else is facing a similar issue or if I am doing something wrong.
Beta Was this translation helpful? Give feedback.
All reactions