-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
regressionBug that causes a regression to a previously working featureBug that causes a regression to a previously working featuretype: bugIssue that causes incorrect or unexpected behaviorIssue that causes incorrect or unexpected behavior
Description
Description
As of 1.9.x I can not longer grab certain attibutes of the posts page using the page query
Steps to reproduce
- Use WPGraphQL 1.9.x
- Set up a page (i.e., "news") to be the posts page in the Reading settings (/wp-admin/options-reading.php)
- Edit this page. Add a featured image via the sidebar.
- Attempt to retrieve this image using following query:
{
page(idType: URI, id: "/news/") {
title
isPostsPage
featuredImage {
node {
alt: altText
src: sourceUrl
}
}
}
}
- In GraphQL explorer, I would get the following error:
"errors": [
{
"debugMessage": "Argument 1 passed to WPGraphQL\\Type\\InterfaceType\\NodeWithFeaturedImage::WPGraphQL\\Type\\InterfaceType\\{closure}() must be an instance of WPGraphQL\\Model\\Post, instance of WPGraphQL\\Model\\PostType given, called in /nas/content/live/example/wp-content/plugins/wp-graphql/src/Type/WPConnectionType.php on line 447",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 5,
"column": 5
}
],
"path": [
"page",
"featuredImage"
]
}
],
"data": {
"page": {
"title": null,
"isPostsPage": false,
"featuredImage": null
}
},
- If I downgrade to WPGraphQL version 1.8.x, I get my intended results:
"data": {
"page": {
"title": "My Cool News Stories",
"isPostsPage": true,
"featuredImage": {
"node": {
"alt": "aerial-view-of-boat",
"src": "https://www.example.com/wp-content/uploads/2020/09/aerial-view-of-boat.jpg"
}
}
}
},
Additional context
No response
WPGraphQL Version
1.9.x
WordPress Version
6.0.1
PHP Version
7.4
Additional enviornment details
Attempted to:
- disable all other plugins except WPGraphQL, problem persisted.
- I checked if Image used still existed in Media Library, and not a weird mismatch or missing image
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.
krishaamer
Metadata
Metadata
Assignees
Labels
regressionBug that causes a regression to a previously working featureBug that causes a regression to a previously working featuretype: bugIssue that causes incorrect or unexpected behaviorIssue that causes incorrect or unexpected behavior
Type
Projects
Status
✅ Done