wp-graphql / wp-graphql-woocommerce

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

WPML with wp-graphql throwing error: Field "language" is not defined #811

Open jakubmas opened 9 months ago

jakubmas commented 9 months ago

Describe the bug I have a gatsby website where I use wordpress and woocommerce. Lately I installed WPML for multi language support and when I try to run project I got this error: There was an error in your GraphQL query: Field "language" is not defined by type "WPWCContent_RootQueryToProductUnionConnectionWhereArgs". It seems that I can't query posts based on language field. I can only get my original products without translation.

Things that might be worth noticing is that I use two plugins to source from wordpress: gatsby-source-graphql and gatsby-source-wordpress. I do that to fetch optimised images from gatsby-source-wordpress (but it doesn't work with WPML). How can I fix it?

Expected behavior I would like to be able to fetch data from Woocommerce based on a language parameter.

Plugin Versions

PPjev commented 7 months ago

Having same issue even in playground. I can query product by language, I can query posts where language all. But I can not query products where language all. No connection for products and languages.

kidunot89 commented 6 months ago

@jakubmas @PPjev Is this issue persisting in v0.18.3?

scesini commented 3 months ago

Looks like the where with language condition is not working anymore. Some idea how to replace this?

'query' => '{ products(last: 10, where: { language: "en" }) { nodes { name link } } }'

cankahya commented 2 months ago

Can confirm, its not working. Did anyone find a workaround to query all products in another language?