5 ms·
> blurs so many boundaries with a pretty poor tradeoff when compared to "normal" APIs. I'd love to hear more on this, I've been feeling this way for a while wh
by ervine 5y ago
> blurs so many boundaries with a pretty poor tradeoff when compared to "normal" APIs.
I'd love to hear more on this, I've been feeling this way for a while when using graphql-code-generator and apollo-client with react. It feels like there's no layer between data coming into the view from the backend.
Because the queries / mutations are strongly typed with typescript, we end up passing the shape of the request around as a Type, so anytime we want to change our queries, we end up having to touch a lot of application code, instead of having a nice layer between that would handle the transformation.
This is exacerbated by the use of apollo-client's `useQuery` and `useMutation` hooks, which really seem to encourage you to make the requests directly from your views.
At first this all feels amazing, but once the codebase is large enough, I am really start to feel like not having a data transformation layer between the requests and the views is insanity, but everything in the documentation and ecosystem seems to encourage you to do it the way I described above.
This may not be at all what you meant, but I'd love to hear your thoughts, I haven't seen anyone else really talk about this.