User connections hasPublishedPosts
should not allow ATTACHMENT
value
#2963
Labels
component: connections
Relating to GraphQL Connections
needs: discussion
Requires a discussion to proceed
object type: user
Relating to the User Type
type: bug
Issue that causes incorrect or unexpected behavior
Description
The
UserConnectionWhereArgs.hasPublishedPosts
is currently of typeContentTypeEnum
, which offersATTACHMENT
as a possible value.However, the underling
has_published_posts
query arg does not support filtering byattachment
.This is confirmed in our test suite (part of #2996) as well.
As a quick "fix", I recommend adding a
graphql_debug()
message alerting users to the bug.Long term, I suggest we deprecate
hasPublishedPosts
in favor of something likehasPublishedContent
, which uses an enum type that doesnt include attachments.Steps to reproduce
hasPublishedPosts: ATTACHMENT
:Additional context
I didnt create a PR to deprecate
hasPublishedPosts
and createhasPublishedContent
because I'm thinking that a "sans-attachment" enum is likely necessary/useful in other parts of the codebase 🤔WPGraphQL Version
1.16.0
WordPress Version
6.3.1
PHP Version
8.1.15
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have disabled ALL plugins except for WPGraphQL.
The text was updated successfully, but these errors were encountered: