I have a Nuxt project with a staging branch which points to the graphQL preview API (read only) to preview draft content. The intention is that authors will see the SSR draft content appearing without requiring a build.
For some reason the listings for some of my models appear instantly whereas other model listings require a build before they’re visible on the staging site.
The only difference I can see is the listings that don’t see draft content are either queried from the store or use Async data whereas the listings that see draft content without a build use apollo smart queries.
Eg this listing sees draft content without a build
apollo: {
allProperties: {
prefetch: true,
query: fetchAllProperties,
variables() {
return this.filtersObject;
},
update(data) {
return data.allProperties;
}
},
}
Vs this listing that needs a build before you see draft records
async asyncData({ app, route }) {
const client = app.apolloProvider.defaultClient;
const allTestiminials = await client.query({
query: fetchAllTestimonials,
variables: { filter: {} }
});
const { allTestimonials } = allTestiminials.data;
return {
allTestimonials
}
}
Any idea if async data is the reason and if there’s a way around it?