Reading in PHP response from Graphql mutation to see if there is an error

Hi All,

I am trying to check for an error response on a post in PHP with the graphql mutation to subscribe/unsubscribe to sales changes.

This is the response I get. How do I read the field “message” so I can check to see if there is an error.

This was the code that didn’t work..I want to to verify the update was successful.

It should be just like this:

foreach ($responseQry->data->publishablePublish->userErrors as $userError) {
    echo $userError->message;
}

That worked perfectly..thank you so much