Mounting multiple document types on root route

We are currently consuming content by client.getByUid endpoint to fetch the page details which requires us to pass document type while fetching the details of the document.

We basically want multiple document types to be mounted on root route itself. So how is it possible for us to handle this in our routes.js.

Is there a specific endpoint or Predicate function that we should use to achieve this through which we can fetch the document just via uid without sending the type of document? or , any other way we can achieve this .

Hello Kapil!

You always need to specify the type of document that you’re asking for when querying by UID and the getByUid predicate is dedicated exactly to do so: retrieve an entire document basing on this field (UID).

The same thing is needed if you were to use GraphQuery syntax. Benefit of GraphQuery is that you can call exactly the fields that you need from that document.