Skip to content

Can't query /shop/ page by contentNode with uri argument when woocommerce is enabled (no wp-graphql-woocommerce required) #1910

@ardiewen

Description

@ardiewen

Really strange and specific issue here... thought it might be downstream to wp-graphql-woocommerce and wp-grapql/wp-graphql-woocommerce#491, but it's present even without the downstream plugin enabled.

Steps to replicate:

  1. Fresh wordpress 5.7.1 and woocommerce 5.2.2 install with wp-graphql 1.3.8, this triggers some pages to be automatically created, such as /shop, /cart, /checkout etc...

  2. Try to query all content nodes, confirming that the shop page with id of cG9zdDo0NA== and URI of /shop/ shows up.:

Screen Shot 2021-05-10 at 6 45 39 PM

  1. Try to query contentNode by URI of /shop/ (no wp-graphql-woocommerce enabled):

Screen Shot 2021-05-10 at 6 47 08 PM

  1. Try to query contentNode by ID of `` (no wp-graphql-woocommerce enabled):

Screen Shot 2021-05-10 at 6 50 13 PM

  1. Turn woocommerce off, forcing all the default included woocommerce pages to disappear, recreating a "shop" page, and then querying it doesn't seem to do anything. Seems that something has been altered in the database maybe? The query looks identical to step 3, where the SQL trace doesn't seem to even be looking for a content node.

Environment

wp-graphql 1.3.8
wordpress 5.7.1
woocommerce 5.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: interfacesRelating to GraphQL Interface Typescomponent: queryRelating to GraphQL Queriesdep: woocommerceIntegration or compatibility with WooCommercenot staleShort-circuits stalebot. USE SPARINGLYscope: extensionsIntegrating plugins, add-ons, or other extensionsstatus: in progressCurrently being worked ontype: bugIssue that causes incorrect or unexpected behavior

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions