Like what we’re doing? Star us on GitHub!

Graphql loaded draft pages with draft: false specified

Stupidism
5 months ago
1 1

It looks a bug to me that I can query out draft pages with following query in the official demo page:
https://demo.payloadcms.com/api/graphql-playground

# Write your query or mutation here
query getPages {
  Pages(draft: false) {
    docs {
      slug
      _status
    }
  }
}

image

I found out I need to add one more filter like this, but I'm still confused

query getPages {
  Pages(draft: false, where:{ _status:{ equals: published } }) {
    docs {
      slug
      _status
    }
  }
}
Open the post
Continue the discussion in GitHub
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More