Access field data from entity in block plugin I'm attempting to render certain fields within a block plugin but I'm not sure where to start as far as accessing the fields so I can render them.

I'm able to get the node ids after I perform the query using the following code.

    $query = \Drupal::entityQuery('node')
        -&gt;condition('type', 'blog_post');
    $nids = $query-&gt;execute();


This retrieves the ids that I need based on the query but I don't know how to access custom fields like blog_summary.

I looked into some functions like getFieldDefinitions(). But I'm not sure how to make use of it. I attempted some things using getStorage but I assumed I wouldn't want to go that route since I'm not attempting to make any changes to the nodes I only want to access their fields.
Try this:

public function build() {
  $query = \Drupal::entityQuery('node')
    -&gt;condition('type', 'blog_post');
  $nids = $query-&gt;execute();

  $build = [];
  foreach ($nids as $nid) {
    $node = Node::load($nid);
    $build[] = $node-&gt;blog_summary-&gt;view();
  }
  return $build;
}