The models are defined on the graphql api and so you never have to worry about manually syncing types on your client code. You will immediately know if your api changed something that will break your code and where.
I'm using the typescript-graphql-request
codegen plugin just to generate the docs and types, and ignoring the generated hooks specific to graphql-request
One could write a react-query
generator that creates a hook for each query that you write but may need some fetcher adapter.
I was going to wait a bit more to see a pattern emerge. I like to use axios
and others use fetch
or other libs.
Perhaps some kind of provider with an adapter for axios
or fetch
or whatever.