We have seen that when creating a custom view for a given content in Plone where we need to show custom query results, Volto does always 2 requests to the back-end API, requesting first the content itself and then the custom query.
We are using this pattern to show a list of newsitems 26. Volto View Components: A Listing View for Talks — Plone Training 2021 documentation
the latest Volto has removed the ?fullobjects query in the getContent and we want to show the image of the newsitems. In the "items" attribute of the API result we have only the id, title, description, so we need to make a custom query to obtain the full objects. We do that doing a searchContent query and render the template (like in the pattern). So far so good. But if we load that page in the browser we see that Volto does 2 queries: the standard query to get the context content and the one we have made to search the full objects.
We have dug in the Volto code and we have seen that the View component does always a getContent call in its UNSAFE_componentWillMount, so it will be always called, regardless we are creating a new view and using the searchContent call.
Is that right? Is there a way to "not to do" the standard getContent call?