wp-graphql / wp-graphql-woocommerce

Add WooCommerce support and functionality to your WPGraphQL server
https://woographql.com
GNU General Public License v3.0
644 stars 131 forks source link

Product where categoryIn returns empty after update #662

Closed Julhol-droid closed 1 year ago

Julhol-droid commented 2 years ago

Describe the bug I updated the Plugin from 0.10.7 to 0.11.2. In the previous Version I was able to query products with "where categoryIn" clause. Like this:

query CategoryIn {
  products(where: {categoryIn: ["add-on", "merch"]}) {
    nodes {
      name
    }
  }
}

Before the update to 0.11.2. the Products were returned correctly, but now the returned nodes are empty. If I use the category where it works correctly. However with this Setup I am only able to query for one Category.

query OneCategory {
  products(where: {category: "add-on"}) {
    nodes {
      name
    }
  }
}

To Reproduce Steps to reproduce the behavior:

  1. Create a Product in Woocommerce and add the category "Add-on"
  2. Create a second Product in Woocommerce and add the category "merch"
  3. Try to query it via the "CategoryIn" query listed above.

Expected behavior The "CategoryIn" query should return both products.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Plugin Versions

Thanks for helping.

Julhol-droid commented 2 years ago

Ok I noticed, that if I downgrade WPGraphql from 1.11.3 to 1.9.1 (my prev version) it works. So it has something to do with WP Graphql I think.

creative-andrew commented 1 year ago

I am having the same problem.

creative-andrew commented 1 year ago

@kidunot89 @jasonbahl any update on this?

hofewo commented 1 year ago

same problem here. The latest working version of WPGraphQL that doesn't have this problem for me is 1.10.0 (working with WooGraphQL 0.11.2)

khalibloo commented 1 year ago

Having the same issue. It also returns empty when trying to filter by product IDs.

Edit: Never mind, it looks like now the IDs is expecting database IDs not graphQL IDs.

kidunot89 commented 1 year ago

@khalibloo @hofewo @creative-andrew @Julhol-droid Can you confirm this issue in v0.12.1?

creative-andrew commented 1 year ago

I can confirm it is working.

image
claudio-uey commented 10 months ago

I am facing this issue. I have wp-graphql-woocommerce v0.18.2, wp-graphql v1.19.0.