Open Kashuab opened 1 year ago
The following approach seems ideal:
schema.graphql
for the local typesgenerate
CLI to generate a root store and modelsQuestions:
mobx-depot
elegantly handle multiple simultaneous stores?Answers:
generate
could handle multiple schemas (I'm really interested in this)rootStore.ts
are named generically, i.e. getRootStore
, setGraphQLClient
I think in an ideal scenario there is only one RootStore
within a project. The solution here may be to allow generate
to accept multiple schemas. However, the big question here is: how would we handle duplicate types? There may be local state that should never make it to the remote API.
Not a pre-release issue, but this is still important.
For some complex apps that need to stage working data,
mobx-depot
could lend a hand with its data store. Its ability to resolve and maintain dependencies could've relieved a lot of headache in projects I've worked with in the past.