mobxjs/mst-gql

How to get the full object, not only primitive fields?

chertkovalex opened this issue · 2 comments

xxxPrimitives is great and save a lot of coding.
But in our case we have a pretty big objects having several nested objects on several levels.
So currently need to create a query with queryBuilder, importing all the primitives from all the nested objects.
And it happens dozens of times.
Is there any possibility to request not only primitives, but the whole object including nested objects and fields?
Maybe it can be some flag, parameter etc?

I think in that case you will face the circular dependencies problem. Could you show the example of such functionality in other frameworks?

you might need to create a single root store with all of our models (there's another circular dependency issue pointing to a script that can help you make that).
The way to retrieve data from other edges is described in the docs (search for selectors).
Keep in mind that your graphql server may have a limit of nesting.
I would discourage using the primitives. Unfortunately, each time you use them and add more selectors, the original string is appended and you will end up with multiple duplicates of selectors.

Good luck :)

BTW. my experience is related to using version 15, I am going to test the 17 but I doubt any corrections were made regarding circular dependencies.