Open KashubaK opened 1 year ago
Update on this, Query
and Mutation
classes no longer directly depend on the RootStore
. Rather, the new DepotGQLClient
handles calling RootStore.resolve
instead. This is more ideal as there's now only one thing that really depends on it.
The generated
rootStore.ts
file stores singletons of theRootStore
andGraphQLClient
, and provides the following functions to access them:getRootStore
,getGraphQLClient
,setGraphQLClient
.The singletons are not exported themselves. The only way to access them is through those functions. This was done as I believe it would be easier to mock the functions within a test environment as opposed to mocking the singletons.
What are the drawbacks of using this method of injection? What are some convenient ways to improve this (if any?)