Skip to content

fix: #1687 fix node resolver when page for posts is set#2464

Merged
jasonbahl merged 2 commits intowp-graphql:developfrom
jasonbahl:bugfix/#1687-fix-node-resolver-when-page-for-posts-is-set
Aug 4, 2022
Merged

fix: #1687 fix node resolver when page for posts is set#2464
jasonbahl merged 2 commits intowp-graphql:developfrom
jasonbahl:bugfix/#1687-fix-node-resolver-when-page-for-posts-is-set

Conversation

@jasonbahl
Copy link
Copy Markdown
Collaborator

What does this implement/fix? Explain your changes.

This fixes a bug where the incorrect Type is returned when a page is set as the "page_for_posts" value.

Does this close any currently open issues?

closes #1687

Any other comments?

When a Page is set as the "page_for_posts" setting under Reading Settings:

CleanShot 2022-08-02 at 16 39 43

Querying the path for that page should return a ContentType and not the Page

CleanShot 2022-08-02 at 16 47 38

Much like visiting the path in the browser returns the "blog" archive with the posts, instead of a static page:

CleanShot 2022-08-02 at 16 43 49

If the reading settings do not have a page_for_posts set

CleanShot 2022-08-02 at 16 45 19

Then a Page type should be returned:

CleanShot 2022-08-02 at 16 47 07

Much like you would see when visiting the WordPress rendered URL:

CleanShot 2022-08-02 at 16 46 41

@jasonbahl jasonbahl requested a review from justlevine August 2, 2022 22:48
@jasonbahl jasonbahl self-assigned this Aug 2, 2022
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 29e8075 and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 81.607% when pulling 29e8075 on jasonbahl:bugfix/#1687-fix-node-resolver-when-page-for-posts-is-set into e62b7b8 on wp-graphql:develop.

Copy link
Copy Markdown
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally with a site_url that isn't localhost, just to be safe.

@jasonbahl jasonbahl merged commit a59ed5b into wp-graphql:develop Aug 4, 2022
@justlevine justlevine mentioned this pull request Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nodeByUri does not return ContentType for Posts Page.

3 participants