function rest_query(){
// Query all posts
$query = new WP_Query( [ 'posts_per_page' => -1 ] );
// Create an array of post IDs for the response
$response = [];
if( $query->have_posts() ) {
while( $query->have_posts() ) {
the_post();
$response[] = get_the_ID();
}
}
return $response;
}