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

Queries and mutations are too similar #20

Closed Kashuab closed 1 year ago

Kashuab commented 1 year ago

The following pairs of things are too similar:

I've always thought of queries and mutations as separate things, one is getting data, one is mutating data. Though perhaps in GraphQL they're practically the same? It'd be nice if we could find a nice way to unite them into one idea. mst-gql's React utilities combines the hooks into one useQuery, but it always felt weird to pass a mutation to it.

Kashuab commented 1 year ago

There are key differences, mainly when caching is involved. Removed MutationGenerator in favor of using QueryGenerator for both use-cases.