Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

This topic contains 2 replies, has 2 voices.

Last updated by Bigul 1 year, 9 months ago.

Assisted by: Bigul.

Author Posts
July 31, 2024 at 2:46 pm #16026211

alessandroD-74

Background of the issue:
I'm trying to use the same GraphQL id for custom taxonomy for different languages and then filter by lang in where condition. The site I need help with is hidden link.

Symptoms:
No specific issue or error message mentioned.

Questions:
How can I use the same GraphQL id for custom taxonomy across different languages?
How do I filter by language in the where condition using GraphQL with WPML?

July 31, 2024 at 2:47 pm #16026213

alessandroD-74

For example for posts using the same taxonomy I can filter by lang = it or en.

While for my own custom taxonomy I can't, I have different IDs for each language

August 1, 2024 at 8:07 am #16028076

Bigul

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

To make sure, is it related to this ticket - https://wpml.org/forums/topic/graphql-and-wpml/

Have you registered the *graphql_single_name* and *graphql_plural_name* for the Custom Taxonomy? Refer to this doc for more details - hidden link

Please share the query you are using to list the custom taxonomy terms in the default language. Also, check whether the following sample query is working for you (you have changed the taxonomy name in the query).

query CustomTerms{
  customTaxs(where: {language: "en"}) {
    nodes {
      name
      id 
      slug
      uri
    }
  }
}

--
Thanks!

Bigul

The topic ‘[Closed] WPML and GraphQL’ is closed to new replies.