title: Gutenberg block get recent pages
body: <p>Based on the <a href="https://wordpress.org/gutenberg/handbook/blocks/creating-dynamic-blocks/" rel="nofollow noreferrer">dynamic block example</a> for retrieving a recent posts block, I'm trying to create a block that retrieves pages.</p>
  
  <p>In the php server component I changed:</p>
  
  <pre><code>$recent_posts = wp_get_recent_posts( array(
      'numberposts' =&gt; 1,
      'post_status' =&gt; 'publish',
  ) );
  </code></pre>
  
  <p>to:</p>
  
  <pre><code> $recent_posts = get_pages( array(
      'post_type' =&gt; 'page',
      'post_status' =&gt; 'publish'
  ) );
  </code></pre>
  
  <p>and get a php error log:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Cannot use object of type WP_Post as
    array in mysite....:24</p>
    
    <ol>
    <li>render_block_latest_pages(Array, '') /mysite/wp-content/plugins/gutenberg/lib/class-wp-block-type.php:108</li>
    <li>WP_Block_Type->render(Array, '') /mysite/wp-content/plugins/gutenberg/lib/blocks.php:238</li>
    <li>do_blocks('') /mysite/wp-includes/class-wp-hook.php:286</li>
    <li>WP_Hook->apply_filters('
    <li>apply_filters('the_content', '
    <li>the_content() /mysite/themes/bt-sass-blank-theme/template-parts/page/content-default.php:7</li>
    </ol>
  </blockquote>
  
  <p>I also tried a normal query and it does not work. Gutenberg works with the Wordpress REST API, not sure if there might be an issue there.</p>