If you have casted the response as a GraphObject by using one of the following two methods:
// Get the response typed as a GraphLocation
$loc = $response->getGraphObject(GraphLocation::className());
// or convert the base object previously accessed
// $loc = $object->cast(GraphLocation::className());
You can use the Get
properties of the graph object, depending on what kind of object you've casted it as... here's an example for the GraphUser
Object:
echo $user->getName();
Or, if you know the name of the property (as shown in the base data), you can use getProperty()
:
echo $object->getProperty('name');
So in your example, you can use the following to get the id
property:
echo $user->getProperty('id');