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

Impossible to fetch menuItems by locale #3

Open
adriandmitroca opened this issue Oct 11, 2020 · 5 comments
Open

Impossible to fetch menuItems by locale #3

adriandmitroca opened this issue Oct 11, 2020 · 5 comments

Comments

@adriandmitroca
Copy link

No description provided.

@rburgst
Copy link
Owner

rburgst commented Oct 14, 2020

this is correct, I am working on it but it will take more time as this is quite complex. In the meantime you can use https://github.com/rburgst/gatsby-source-wordpress-menus

@adriandmitroca
Copy link
Author

Same applies to pages by the way.

@rburgst
Copy link
Owner

rburgst commented Feb 27, 2021

via 8ba0b49 you can now get the language for each menu item. However, filtering by language is not yet supported unfortunately.

@retzion
Copy link

retzion commented Mar 12, 2021

I'm getting the menuItems by language with the following query, but it is only working in GraphiQL and not in my Next.js app.

query PrimaryMenuByLocale($locale: String = "en") {
  menuItems(where: {location: MENU_1, language: $locale}, first: 100) {
    nodes {
      key: id
      parentId
      title: label
      url
      locations
      path
    }
  }
}

@rburgst
Copy link
Owner

rburgst commented Mar 13, 2021

@retzion I fear you are correct. While the plugin already registers the corresponding filters I am fairly certain that filtering everything (especially menu items) by language does not yet work. This is unfortunately quite a tricky problem.
Also my main focus is to make the plugin work for gatsby queries (where you can do all the filtering on the gatsby graphql model).
I will try to make some time to get this working but dont hold your breath. If you want to contribute and make the plugin better, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants