I've gone through the documentation and the source code but I couldn't understand.
I have 2 queries:
getEntityRecords( 'postType', 'post' );
and getEntityRecords( 'root', 'user' )
.
- Why does the 2nd query require
root
as the 1st argument? - What does it mean?
- How to determine when to use it?
The doc describes the parameters of getEntityRecords
as following:
Parameters:
- state Object: State tree
- kind string: Entity kind.
- name string: Entity name.
- query ?Object: Optional terms query.
- Are
postType
androot
both state trees? - How does
state
relate tokind
while referring to entities.js?