We are working into it. At the moment, a solution to this issue has not yet been made, as soon as there is some progress on this issue, we will additionally inform you in this topic.
Yes, this is the right way to load relations while load object by its id.
Let me explain a few points:
to load an object by its objectId you should pass the first parameter “objectId” as a “String”
if you have external databases which is supported in Pro and Manage installations and where some tables might have more than one primary keys you can pass the first arguments as an object, for example, table Foo has two primary keys: “id” and “name” and to find the object you have to pass as the first argument an object with this keys: { name: “bob”, id: “12345” }
if the first argument is an object all the properties of the object will be added to url as query parameters, “?name=bob&id=12345”
to use other features such as “load relations”, “filter props” for that object you can pass as the second argument DataQueryBuilder instance or and object with corresponding properties
as you can see this is not a good way to mix the primary keys and query-builder params in a single object
Thank you @vladimir-upirov for the advice and information and also @stanislaw.grin for the code example. Fully understand and my code has been updated which is working now. Thank you.