Unable to Make Menus and Menu Items public
hmingv opened this issue · comments
Description
We have no problem using the code below when using WP-Graphql V1.12.2.
Make Menus and Menu Items public
When I updated to V 1.22.1 it had no effect.
Steps to reproduce
- Install a clean WordPress installation
- Install WPGraphQL V1.12.2 version
- Add the code in the document to the theme or plug-in
- Test (everything is fine at this point)
- Update WPGraphQL to the latest version
- Test (failed)
Additional context
No response
WPGraphQL Version
1.22.1
WordPress Version
6.4
PHP Version
8.1
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have disabled ALL plugins except for WPGraphQL.
- Yes
- My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
After testing, I traced that the problem started appearing in version V1.22.0.
Depending on the theme we are using, the menu will not have its location set.
Does this have anything to do with it?
However, logged in users can view all menus, but they cannot be read publicly.
Thanks for reporting this @hmingv !
If you're tracing the change in behavior to v1.22.0, it's likely coming from #3043 . Whether this is a regression, intended behavior that requires updating that recipe, or the result of relying #3029 as a feature in your local query s another story.
In order for us to replicate and debug, can you please provide:
- The GraphQL query you are fetching (bonus points if you can also screenshot it with the results in the GraphiQL IDE)
- Your menu config (including the menu location it's assigned to, or whether it is unassigned).
Thanks!
GraphQL query:
query MenuItems {
menuItems(first: 200, where: {parentDatabaseId: 0}) {
nodes {
id
label
uri
childItems {
nodes {
id
target
childItems {
nodes {
id
label
target
uri
description
cssClasses
childItems {
nodes {
id
label
uri
target
cssClasses
}
}
}
}
}
}
}
}
}