Skip to content

Date Archives don't resolve with nodeByUri queries #2191

@jasonbahl

Description

@jasonbahl

In WordPress, if you have dates setup in your permalinks, you can visit a url such as /2021/12 and get an archive of posts from December 2021.

Or you could do /2021 and get an archive of posts from the year 2021.

Or you could do /2021/12/22 and get an archive of posts from December 22, 2021.

In WPGraphQL, these paths passed to nodeByUri will return null.

WordPress core behavior:

I can visit the url /2013/03/15/ and see an archive of posts for March 15, 2013.

Inspecting the DOM, I can see the body class outputting "archive date"

Screen Shot 2021-12-22 at 11 14 58 AM

WPGraphQL Behavior:

If I enter the same uri in WPGraphQL, I get null:

Screen Shot 2021-12-22 at 11 16 08 AM

I would expect to get a ContentType node in response, and I would expect the connections to the ContentNodes to be pre-filtered to the date

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: connectionsRelating to GraphQL Connectionstype: bugIssue that causes incorrect or unexpected behavior

    Type

    Projects

    Status

    🗺 Planned

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions