Log WPGraphQL requests to error log
This snippet logs all WPGraphQL requests to the error log
add_action( 'do_graphql_request', function( $query, $operation, $variables, $params) {
error_log( wp_json_encode( [
'query' => $query,
'operation' => $operation,
'variables' => $variables,
'params' => $params
] ) );
}, 10, 4 );