How to get the contents created by a User?
$currentUser = \Drupal::currentUser();
$query = \Drupal::entityQuery('node');
$query-&gt;condition('uid', $currentUser-&gt;id());
$author_nids=$query-&gt;execute();