3 ms·
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. Fee
by markhalonen 7y ago
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
- antigirl 7y agoThats 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
- latchkey 7y agoI'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!