Re:PostgREST
by markhalonen on Sunday November 03, 2019 @03:38PM
(#21436418)
I've been using Postgraphile along with Apollo Client with code-generated types for queries. When I change the db schema, I get compile errors in my client. Feels like I'm cheating
[ Parent
| on HN ]
I'm doing something similar, but using type-graphql + apollo server + graphql-code-generator + mikro-orm (v3).
I just define my model classes. Graphql resolvers look like regular rest endpoints. Everything else is generated from there and I even get compile errors for my apollo client queries too.
I really love the typesafety of it all!
Thats just bad schema definitions then, you should have defaults and upon making mutations with only a subset of parameters it shouldnt fail,
queries shouldnt fail anyway.
If you are actually changing variable names then your client would fail regardless of what you're using