We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Steps to reproduce:
Filter the "Menu" Models to make them public:
add_filter( 'graphql_data_is_private', function( $is_private, $model_name, $data, $visibility, $owner, $current_user ) { if ( 'MenuObject' === $model_name || 'MenuItemObject' === $model_name ) { return false; } return $is_private; }, 10, 6 );
Create a menu, but don't assign it to a location (this would be a private menu by default).
Query for the menu:
{ menu(id: "Menu with no Location", idType: NAME) { id name menuItems { nodes { id label } } } }
See that you can get the menu as a public user:
Enable Error Logging for WPGraphQL Smart Cache.
Update the menu you just queried.
PROBLEM
See that there are no purge events for the menu being edited, even though it's been filtered to be a Public model.
EXPECTATION
I would expect for a menu that's been filtered to be public to log an event such as:
[17-May-2023 20:35:37 UTC] (graphql_purge) key: dGVybTo0MA==, event: updated_nav_menu, user: 1, page: /wp-admin/nav-menus.php [17-May-2023 20:35:37 UTC] (graphql_purge) key: skipped:term, event: updated_nav_menu, user: 1, page: /wp-admin/nav-menus.php
The text was updated successfully, but these errors were encountered:
Merge pull request #221 from wp-graphql/fix/#220-menus-are-considered…
4f1392b
…-private-even-if-model-has-been-filtered-to-public fix: updating menus not assigned to locations doesn't purge menus, even if their model is public
jasonbahl
Successfully merging a pull request may close this issue.
Steps to reproduce:
Filter the "Menu" Models to make them public:
Create a menu, but don't assign it to a location (this would be a private menu by default).
Query for the menu:
See that you can get the menu as a public user:
Enable Error Logging for WPGraphQL Smart Cache.
Update the menu you just queried.
PROBLEM
See that there are no purge events for the menu being edited, even though it's been filtered to be a Public model.
EXPECTATION
I would expect for a menu that's been filtered to be public to log an event such as:
The text was updated successfully, but these errors were encountered: