Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jakubmas opened this issue Oct 6, 2023 · 4 comments
Open
Labels
bug Something isn't working

Comments

@jakubmas
Copy link

jakubmas commented Oct 6, 2023

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

  • WooGraphQL Version: 0.18.1
  • WPGraphQL Version: 1.16.0
  • WordPress Version: 6.3.1
  • WooCommerce Version: 8.1.1
@PPjev
Copy link

PPjev commented Nov 10, 2023

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
Copy link
Member

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

@kidunot89 kidunot89 added the bug Something isn't working label Dec 12, 2023
@kidunot89 kidunot89 added this to the v0.18.4 milestone Dec 12, 2023
@kidunot89 kidunot89 modified the milestones: v0.18.4, v0.19.1 Dec 27, 2023
@scesini
Copy link

scesini commented Mar 29, 2024

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
Copy link

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

@kidunot89 kidunot89 removed this from the v0.19.1 milestone May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants