wp-graphql / wp-graphql-woocommerce

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

Ciritcal bug - Product types #583

Closed stevezehngut closed 2 years ago

stevezehngut commented 2 years ago

Describe the bug I think I have discovered a bug with WooGraphQL (v0.10.3+). It looks like graphQL is not recognizing product types and throwing errors like "This product of ID x is not a xyz product”.

To Reproduce Steps to reproduce the behavior:

  1. Create a fresh install of WordPress.
  2. Install and activate WooCommerce.
  3. Create a sample simple product.
  4. Install and activate the latest wp-graphql and wp-graphql-woocommerce plugins.
  5. Go to the GraphiQL IDE.
  6. Create a query that gets a simpleProduct. Example:

query MyQuery { simpleProduct(id: "12", idType: DATABASE_ID) { id name } }

  1. This will display an error message like "message": "This product of ID 12 is not a SimpleProduct product".

Expected behavior The result should be successful.

Screen Shot 2021-12-02 at 10 57 22 AM

Screenshots Attached.

Desktop (please complete the following information):

Plugin Versions

Additional context I will create a pull request for this.

kidunot89 commented 2 years ago

@stevezehngut Just want to confirm that this was only effecting the individual product type queries like simpleProduct, variableProduct, ...etc?