Fixes bug with Comment Authors not always returning#2350
Merged
jasonbahl merged 1 commit intowp-graphql:developfrom Apr 22, 2022
Merged
Fixes bug with Comment Authors not always returning#2350jasonbahl merged 1 commit intowp-graphql:developfrom
jasonbahl merged 1 commit intowp-graphql:developfrom
Conversation
…uthor (public) by default, and only use the User node if it's publicly visible - update test to query publicly and authenticated
|
Code Climate has analyzed commit fc4638d and detected 0 issues on this pull request. View more on Code Climate. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix? Explain your changes.
This fixes a bug where Comment Authors are not always returned if the author is a user, and the user is not considered a public node.
Does this close any currently open issues?
closes #2348
Any relevant logs, error output, GraphiQL screenshots, etc?
Scenario:
Given a user (in my case with
databaseId: 4) that has no published content in any public post type, have that user post a comment and approve the comment.Before:
This comment will return
nullfor the author (because the User Model Layer prevents the User from being returned):After:
The author is returned as a public
CommentAuthorType:Any other comments?
Authenticated users would get a
UserType returned instead of theCommentAuthortype. This would be useful for things like administrative UIs where more information about the User might be used in the UI: