You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated rootStore.ts file stores singletons of the RootStore and GraphQLClient, 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?)
The text was updated successfully, but these errors were encountered:
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?)
The text was updated successfully, but these errors were encountered: