Kashuab / mobx-depot

Scaffold MobX-powered models, queries and mutations with your GraphQL schema.
https://mobx-depot.dev
MIT License
8 stars 0 forks source link

Implement some sort of RootStore #2

Closed KashubaK closed 1 year ago

KashubaK commented 1 year ago

We need a RootStore that stores all working instances.

RootStore should be able to:

Let's keep local instantiations in mind. I should be able to create an instance on the fly, store it in the RootStore, perform a mutation that transports the data to the server and updates that same instance in response. Though already without thinking too much about it, this seems impossible as there's no identifier to connect the dots. Perhaps the solution there is just to move the data from the response, including the ID, into the local instance.

KashubaK commented 1 year ago

Implemented, see fb39c38

The types are hard to figure out here. Still some clean up to do there, but the code works at this point.