How to see draft content on staging without a build?

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?

Hello @jacktcunningham_publisher

Are you using the real time updates APIs to fetch the content?
With them you can avoid a re-build and see the changes reflected directly after an API change
Maybe you are only using it in certain parts of your project.
Here is the documentation on how to set it up:

I’m using the regular GraphQL read-only api in all cases. And if I pre out the response I see the draft content immediately after a refresh but only for some models.
My understanding with nuxt is that the build is just for SSG but you should get the up to date content as soon as SSR kicks in and the page hydrates. This would be perfect for the staging site as I would only need it to work with SSR. So just not sure why some of my models don’t update in that way?

Are you querying the preview endpoint for all of your queries where you wish to access draft content? Content Delivery API - API Endpoints - DatoCMS Docs

If you are, send your project over to support@datocms.com so we can take a closer look at what could be happening