ConrabOpto / mst-query

Query library for mobx-state-tree
MIT License
110 stars 7 forks source link

Generators #14

Closed k-ode closed 1 year ago

k-ode commented 2 years ago

Would be nice to build model generators based on backend schemas like graphql. We should be able to use something similar to what is being used in mst-gql.

Generating models should mostly just work, but I'm curious if we could also generate stores/queries/mutations?

k-ode commented 1 year ago

We now have a graphql generator.

beepsoft commented 1 year ago

It seems quite similar to the approach of https://github.com/mobxjs/mst-gql. Are you aware of that project?

k-ode commented 1 year ago

@beepsoft The issue text says as much :)

This library started out as a fork of mst-gql. The generator is also based on the one in mst-gql, but is completely re-written in typescript.

beepsoft commented 1 year ago

@k-ode Sorry, I missed that. :-) mst-gql's generator is a bit outdated, so, do you think it would be possible to somehow port back your generator there? Or maybe have a common generator used by both projects? I see, for example, that you have less generator options, but the overall generated models seems to be quite the same.

k-ode commented 1 year ago

@beepsoft Yes, it should be fairly straightforward to backport it to mst-gql.

I don't think I'd be interested in a shared generator, as I might want to do some things specific to mst-query when generating model and root stores.

Would be interested to know if there's anything in mst-gql that you are missing from mst-query. In my mind mst-query should at this point be a more powerful alternative to mst-gql.