Filter the output from wpseo_json_ld_output

I need to modify the price of a product in the JSON+LD.

Since the new update from Yoast it is not possible to edit the ld+json string (structured data). Using this function:

  public function update()
        add_filter('wpseo_json_ld_output', [$this, 'change_yoast_ld_json_file'], 10, 1);

    public function change_yoast_ld_json_file($data)

        $data[] = 'add some data';
        return $data;


When I dump the $data ill get this:

  string(105) "Please use the "wpseo_schema_*" filters to extend the Yoast SEO schema data - see the WPSEO_Schema class."

Now obviously I have gone and read the API docs from wpseo (

It says to do this:

add_filter( 'wpseo_schema_article', 'example_change_article' );

 * Change @type of Article Schema data.
 * @param array $data Article data array.
 * @return array $data Article data array.
function example_change_article( $data ) { 
  $data['@type'] = 'NonsensePage'; 
  return $data; 

However, there is no "product" class for me to modify the output.

I dumped out the whole graph pieces:

add_filter( 'wpseo_schema_graph_pieces', 'wc_seo_filter2' );

function wc_seo_filter2( $data ) {

    echo "NonsensePage2";
    return $data;

However, when I do this, there is no "price" field anywhere in the array that is returned.

Can someone point me in the direction to be able to modify the "price" field for a woocommerce product?