Fetching only first row from database
$query = \Drupal::entityQuery('node')
            -&gt;condition('status', 1)
            -&gt;condition('type', 'my_content_type')
            -&gt;condition('field_ref_au', $nid, '=')
            -&gt;range(0,1)
            -&gt;sort('created', 'DESC')
        ;