-
Notifications
You must be signed in to change notification settings - Fork 468
Post Format archives don't resolve with nodeByUri query #2190
Description
After enabling post formats using the snippet below:
add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) );And creating a post assigned to the video format, like so:
I can visit the url /type/video and get an archive of posts of said post-format.
We can see in the "body class" that WordPress is resolving this to the archive of the post format.
However, if we take the uri and use it in a nodeByUri query, we get a null response.
query:
query GetNodeByUri($uri: String!) {
node: nodeByUri(uri: $uri) {
...NodeByUri
}
}
fragment NodeByUri on UniformResourceIdentifiable {
__typename
uri
id
...DatabaseIdentifier
...ContentType
...User
...TermNode
...ContentNode
...MediaItem
}
fragment DatabaseIdentifier on DatabaseIdentifier {
databaseId
}
fragment MediaItem on MediaItem {
id
mimeType
}
fragment ContentType on ContentType {
name
isFrontPage
isPostsPage
}
fragment TermNode on TermNode {
isTermNode
slug
taxonomyName
}
fragment ContentNode on ContentNode {
isContentNode
slug
contentType {
node {
name
}
}
template {
templateName
}
}
fragment User on User {
nicename
databaseId
}variables:
{
"uri": "/type/video"
}
Result
The result is null. WPGraphQL doesn't properly return the PostFormat node as expected.
Expectation
I expect to get a node of the PostFormat type in response to the query.
Similar to if I queried a category by URI, like so:
Additional Info:
WPGraphQL does properly expose the PostFormat type to the Schema. We can query like so:
{
posts {
nodes {
id
title
postFormats {
nodes {
id
name
uri
}
}
}
}
}And get a response like so:
So it doesn't appear to be an issue with Post Formats not being supported by WPGraphQL, just seems like a nodeByUri resolver issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status




