Content stage only showing `Draft` & not `Published`
I've published two documents on the CMS and I'm fetching + rendering them inside my Next.js application.
I want to render only those documents which are in the published stage, and not in draft.
When I fetch the content using GraphQL in the API playground, the stage attribute is always in the draft stage, even after I published it.
GraphQL query
query getBlogStage{
portfolioBlogs {
id
title
stage
}
}
Output

In the specific content, it's also showing the published stage

I would appreciate if anyone could find possible fix for this.
Yeah, I am also stuck with the same issue. Please share a possible fix
Hey @SanyamPunia @TontofourK
Have you tried updating the query to include a stage argument? Something like this should work for you...
query getBlogStage {
portfolioBlogs(stage: PUBLISHED) {
id
title
stage
}
}
This is because the "default stage" is DRAFT. You can alternatively update the Playground to use the Published stage. This essentially does the above for playground purposes but you should always set the stage in the query.
You can also set your access tokens to have a specific stage scoped which is what I do in 99.9% of the time.