-
Notifications
You must be signed in to change notification settings - Fork 466
Description
Description
unable to query the draft pages. i've tried several methods to query. it's not working. when i published the page that shows the data.
query PreviewNode($id: ID!) {
preview: contentNode(id: $id, idType: DATABASE_ID, asPreview: true) {
__typename
...PageFragment
}
published: contentNode(id: $id, idType: DATABASE_ID, asPreview: false) {
__typename
...PageFragment
}
}
fragment PageFragment on Page {
id
title
}
DRAFT OUTPUT:
"data": {
"preview": null,
"published": null
},
PUBLISHED OUTPUT:
"data": {
"preview": null,
"published": {
"__typename": "Page",
"id": "cG9zdDozMzY2ODk=",
"title": "Test Page"
}
},
Steps to reproduce
query PreviewNode($id: ID!) {
preview: contentNode(id: $id, idType: DATABASE_ID, asPreview: true) {
__typename
...PageFragment
}
published: contentNode(id: $id, idType: DATABASE_ID, asPreview: false) {
__typename
...PageFragment
}
}
fragment PageFragment on Page {
id
title
}
Additional context
WPGraphQL Version
2.3.3
WordPress Version
6.8.1
PHP Version
8
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have disabled ALL plugins except for WPGraphQL.
- Yes
- My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status