-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
gatsby-source-wordpress: Get menus #2426
Comments
Here you go allWordpressWpApiMenusMenusItems {
edges {
node {
name
count
items {
order
title
url
wordpress_children {
wordpress_id
title
url
}
}
}
}
}
Then, in Does this gives the data you expected ? |
Closing this issue, please reopen if you feel that more information is needed :) |
It looks like the routes for the Wordpress plugin have changed? This seems like the route for me: I've installed the Plugin within Wordpress, but I'm getting |
I'm using I should also note that the endpoints are available via the REST API, so i'm at a loss as to why I can't see the menus in GraphiQL |
And... hours later i run |
Having this issue as well: Gatsby 2.4.6/WP API Menus 1.3.1/WP 4.9.8 @braco's fix did not work. Also tried completely deleting the .cache directory and no change. Here is the error:
It doesn't even list a suggested query param for the menu. What is the proper query parameter? |
@loganfromlogan and others. I found a solution - maybe this applies or can help someone else. In your
Without that, Gatsby doesn't query the menus at all :) |
Thanks @braco and @joshuaiz , your combined solutions worked for me. However, we should probably move to the |
This seems to be still an issue, I don't get Just getting Got the right version of WP-API-MENUS and the current gatsby version is 2.5.4 |
Same here @eemeeli. Perhaps this should be reopened? |
@paulmasek I noticed that the "problem" for me was, on the WordPress install. I didn't have default main menu on WordPress and had two custom menus. One for main language and for the secondary language. Tested with other WordPress site that had only one menu / default main menu the |
@eemeeli thanks for that - much appreciated. I do have two custom menus on my wordpress instance and no default one, so perhaps the same issue is occurring for me. Surely a bug though, and a bizarre one at that :/ |
Including
|
Nothing has worked for me. |
@jarrodmedrano see if this helps. |
Thanks. @jonniebigodes I eventually got it to work using your post. But I'm not really sure what the problem was. |
Hello again,
There was this issue discussing the manner of getting menus and their locations, with @sebastienfi suggesting to use allWordpressWpApiMenusMenusExtended, but the plugin seems to have been updated since (the docs a bit later, which was confusing) because that node no longer exists.
So my question is: Is there, at the moment, any way to fetch the menus of Worpdress? Possibly according to their location? And if not is there an ETA on this feature?
Thank you.
Edit: I have just now noticed that the docs changed. However, with
WP Api Menus
installed on Wordpress, and the latest Gatsby version running, I can't run the basic example ofAllWordpressWpApiMenusMenuLocations
. Getting the errorCannot query field \"allWordpressWpApiMenusMenusLocation\" on type \"RootQueryType\". Did you mean \"allWordpressWpApiMenusMenus\", \"wordpressWpApiMenusMenus\", or \"allWordpressWpStatuses\"?
The text was updated successfully, but these errors were encountered: