Is it possible someone help me on this?
I'm trying to get the number of items on Collection before insert a new item, to set the ID properly.
So I created a Hook to do this. When I run it without a query, it works (the Hook is configured properly and the permissions as well). But when I run a query inside the Hook to get the count, the item is inserted with the field empty.
I realized that we don't need to return the item, it's just an option, because when I set the new ID property whitout a query, and not returning the item, it has been inserted ok.
So, I think, as a query waits a promise, maybe the item is being inserted before this resolution.
How can I resolve this?