If you use the _fields argument, then it needs to include id. Otherwise, getEntityRecords() will always return a null, even if the REST API request succeeded.
So to fix the issue in question, you just need to add id to your args, i.e. _fields: 'id,name,slug'.
You should also know that per_page is limited to 100, so even if you set it to a greater number or even -1 (which means all), the value is always set to max 100.
Related Posts:
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- Extend core block in Gutenberg
- Gutenberg custom block plugin with custom image sizes
- Get loading state of wp data selector
- Hooking a callback into the code within a Gutenberg block
- What do the args for Gutenberg subpackage “hooks” function “doAction” mean?
- Use useSelect/useDispatch instead of withSelect/withDispatch
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- How to transform a legacy widget into a block
- Get Block Attributes in JSON REST API
- Checks when fetching data from multiple REST API endpoints in Gutenberg
- Search for a keyword across post types in a Gutenberg component
- Using apiFetch for retrieving post data in Gutenberg
- useSelect second parameter
- Issue migrating a checkbox-type meta field to the block editor
- Update block once an API request returns with a value
- useSelect() plus resolver result is serving cached data incorrectly
- Gutenberg – remove / add blocks with custom script
- What are all the query parameters for getEntityRecords?
- REST API: Backbone and custom endpoint
- How to only enqueue block javascript on the frontend when its needed [duplicate]
- Gutenberg extend blocks add new class name
- initial open/toggle PluginDocumentSettingPanel panel in document setting block editor gutenberg
- WP REST – video and audio players
- When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
- Get post from custom REST endpoint in Gutenberg
- Headless WordPress: How to authenticate front end requests?
- Correctly handling WordPress core data retrieval in Gutenberg
- Is there a client side API for handling transients or options?
- How to handle malformed response from WP REST API?
- Rest API authentication issue when called from fetch request in bundle.js
- WordPress Rest API only returns content when posttype has editor capability
- Adding a text element in between title and blocks container
- Gutenberg RichText
- How to handle Gutenberg wp.data async errors?
- Load script after block is inserted
- How do I access site and block editor state data and use `useSelect()` or `withSelect()` to bind it to my components?
- Block Editor: How to get title and post content within the WordPress admin UI in Javascript?
- Custom block SelectControl works but equivalent ComboboxControl gives errors – where’s my mistake?
- Gutenberg add extra attributes to custom format
- How to update a meta field of type array in Gutenberg
- event/callback on block update?
- How to disable inline css styles generated by Gutenberg editor?
- Gutenberg getMedia() in post query doesn’t return all featured images
- Add A Tag To A Post Through JavaScript In Gutenberg UI?
- Gutenberg select categories
- Adding nonce or hashes to inline scripts
- How to return div with custom attributes(Coding a Gutenberg Block)
- What is the correct way to import the blocks-editor?
- Open MediaUpload from external component in Gutenberg
- Setting/unsetting terms using the Backbone JavaScript client
- Gutenberg extend blocks add new class name
- Looping over wordpress meta to create “ ‘s?
- How to display post content in the block editor
- is_front_page() variable not found
- what is the purpose of the namespace argument when customizing blocks?
- Gutenberg consume wp-json data and reflect in frontend the content
- How can I import one custom block into another?
- Gutenberg Blocks: how to determine an index of the current inner block?
- Gutenberg select excerpt, use generated excerpt or use more block excerpt
- find out reason of “Updating failed” in Post-editor
- Gutenberg RangeControl
- Custom Gutenberg block: access dom element via JavaScript
- how to use nimble-API and Display data?
- Add a Page Screen is Visually Blank
- wp-api Backbone JS Client fetch options
- Including dependencies using @wordpress/dependency-extraction-webpack-plugin
- Gutenberg sidebar show input field on toggle
- Get the ID of a page in Parent combobox in editor
- Uncaught TypeError: r is not a function
- [Vue warn]: Error in render: “TypeError: Cannot read property ‘wp:featuredmedia’ of undefined – REST API
- Get user in rest API endpoint
- How to improve WP-Rest atrocious response time?
- How do I make a savable preview like Youtube Gutenberg block?
- iFrame onLoad in custom Gutenberg block
- I would like to retrive JSON value and display it in wordpress page or widget
- Connecting a wordpress site to an AngularJS APP
- WordPress Gutenberg: Attribute overwritten by block duplicate
- Filtering Gutenberg Components, not Blocks
- Where to include JS library in gutenberg blocks
- WP REST API – “rest_user_cannot_view” ONLY on specific users
- Passing object to FormTokenField suggestions
- How to add a new attribute to core wp block editor without npm?
- How do i get an Inline style in Gutenberg Block show up in front end?
- Gutenberg core/file add style support in js/ json
- Working with a non-React external library in a custom block
- Create Youtube embed block with createBlock
- Masonry gallery block is working in the block editor but not the template editor
- How to import the imagesLoaded and Masonry libs that come with WP in a Gutenberg block?
- How to use useSelect to retrieve the currently default fontFamily?
- config @wordpress/scripts with webpack and postCSS features
- How to build BOTH non-block components and blocks present in the /src directory using @wordpress/scripts
- How to add an additional dependency to a block index.asset.php file
- How to transform a shortcode into a block
- How to re-render Gutenberg component when object instance is available
- How to access current discussion settings in gutenberg via JS?
- Gutenberg DatePicker component with time set to zero
- How to render HTML content using the Interactivity API?
- How to auto rename JS files to prevent browser cache issues
- How to render initial posts on page load in a Gutenberg block using the Interactivity API?