Skip to content

graphql_data_is_private not getting called #2518

Discussion options

You must be logged in to vote

@lance-anderson if I add your code like so:

add_action( 'init', function() {

	error_log('>>>>>>>>>>>>> call graphql_data_is_private >>>>>>>>>>>>>>>>');

	add_filter(
		'graphql_data_is_private',
		function( $is_private, $model_name, $data, $visibility, $owner, $current_user ) {
			error_log('>>>>>>>>>>>>> graphql_data_is_private callback >>>>>>>>>>>>>>>>');
			return false;
		},
		10,
		6
	);

});

Then execute the following query:

{
	posts {
    nodes {
      id
      title
    }
  }
}

I see the following output in my error log:

[21-Sep-2022 20:57:35 UTC] >>>>>>>>>>>>> call graphql_data_is_private >>>>>>>>>>>>>>>>
[21-Sep-2022 20:57:35 UTC] >>>>>>>>>>>>> graphql_data_is_private callback …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jasonbahl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants