Closed KashubaK closed 1 year ago
RootStore
and GraphQLClient
are now injected into each Mutation
class. This may not be optimal but I can't think of another optimal solution. I don't want to pollute the RootStore
with the responsibility of encapsulating mutations and queries.
This will work for now as there are exported functions to access these "globals", which should be easily mockable but I'm not too sure if that's the best solution. One could also directly mutate the __rootStore
and __client
properties of a Mutation
instance.
The generated
Query
andMutation
classes are not yet aware of theRootStore
. Somehow this needs to be the case, so they can resolve the response data into their respective models.