Skip to content

Querying Page by URI doest require correct URI field  #3042

Description

@andremendonca03

Description

When querying for pages or posts by URI, it returns any match of the uri even if it's incomplete. It turns out to be a problem when parent/child relationships are in place.
i.e. I've got a test page which URI is /about/test/ but it can still be queried just with a fraction of the URI like bout/test/ or even just /test/

Screenshot 2024-02-08 at 4 22 43 pm
Screenshot 2024-02-08 at 4 23 23 pm

Steps to reproduce

  1. Query for any page/post/cpt using IdType: URI

Additional context

No response

WPGraphQL Version

1.21.0

WordPress Version

6.4.3

PHP Version

8.3.0

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.

Metadata

Metadata

Assignees

Labels

component: queryRelating to GraphQL Querieseffort: medLess than a weekhas: workaroundA temporary workaround has been providedimpact: highUnblocks new use cases, substantial improvement to existing feature, fixes a major bugobject type: postRelating to the Post Object Typesscope: apiIssues related to access functions, actions, and filtersstatus: actionableReady for work to begintype: bugIssue that causes incorrect or unexpected behavior

Type

No fields configured for Bug.

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions