Wordpress Gutenberg - Sidebar get posts list based on selected category

I need to display the complete posts list in the dropdown list in the custom block sidebar.

I used for that withSelect:

...
    const currentPostId = select('core/editor').getCurrentPostId();

    const query = {
                orderby : 'date',
                order : 'asc',
                status : 'publish',
                per_page: -1,
                exclude: currentPostId,
    }
    return {articleList: select('core').getEntityRecords('postType', 'post', query)}

...

My issue is that I have a lot lot lot lot ... of posts and so it takes a life to get the list in my selectControl.

I so tried to reduce the number of retrieved posts by first selecting the list of categories (same king of code). But how can I so retrieve posts based on the selected category?

Thx!

Topic block-editor select sidebar Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.