We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently we have a site where a bunch of pages were set to draft, but they are still appearing in the published site menus.
It looks like wp-graphql returns menu items regardless of the connectedObjects post status: wp-graphql/wp-graphql#891
We can add this graphql to see the status of the object:
nodes{ connectedObject { ... on Page { id status } } }
When it returns a public response, we're good:
"connectedObject": { "id": "cG9zdDoxMjIw", "status": "publish" }
However it's hard to distinguish an unpublished page:
{ "id": "cG9zdDo2NjQ=", "databaseId": 664, "label": "Events", "parentId": "cG9zdDo2NjE=", "url": "https://site.wpengine.com/?page_id=205", "path": "/", "target": null, "cssClasses": [], "connectedObject": null },
and an external url:
{ "id": "cG9zdDo5NTQ=", "databaseId": 954, "label": "Local Partners", "parentId": "cG9zdDoxMDk1", "url": "https://site.com/partners#local-partners", "path": "https://site.com/partners#local-partners", "target": null, "cssClasses": [], "connectedObject": null },
One possibility is to exclude anything with ?page_id in it, but that feels potentially unreliable.
?page_id
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently we have a site where a bunch of pages were set to draft, but they are still appearing in the published site menus.
It looks like wp-graphql returns menu items regardless of the connectedObjects post status:
wp-graphql/wp-graphql#891
We can add this graphql to see the status of the object:
When it returns a public response, we're good:
However it's hard to distinguish an unpublished page:
and an external url:
One possibility is to exclude anything with
?page_id
in it, but that feels potentially unreliable.The text was updated successfully, but these errors were encountered: