Get url path of node using entity query I'm trying to figure out how I can get the path of a node via entity query. So far I've managed to fetch the title of the node but I can seem to find a solution on how to get the node path/url. Here is a sample of my code  

$facultyPostings = $query-&gt;get('node')
                           -&gt;condition('status', 1, '=')
                           -&gt;condition('type', 'careers')
                           -&gt;condition('field_career_directory', 'Faculty Postings', '=')
                           -&gt;sort('created')
                           -&gt;execute();

foreach ($facultyPostings as $key =&gt; $faculty_postings_careers) {


     $careersNode = _nodeLoad($faculty_postings_careers);



    $variables['faculty_postings'][$key]['title'] = $careersNode-&gt;get('title')-&gt;value;
    $variables['faculty_postings'][$key]['path'] = $careersNode-&gt;get('path')-&gt;value;
}
It depends on what you want to generate. To get the \Drupal\Core\Url object for the node:

$node-&gt;toUrl();


To get a URL string:

$node-&gt;toUrl()-&gt;toString();


To get a \Drupal\Core\Link object:

$node-&gt;toLink();


To get an HTML string for the link:

$node-&gt;toLink()-&gt;toString();