Is anybody generating TS types for their API layer...
# orm-help
f
Is anybody generating TS types for their API layer to be consumed by their (typescript) frontend ?
s
i’ve been trying to do this but it’s non-trivial
apollo (not prisma) has this codegen thing but it’s a bit hacky in my experience
also this issue has been a problem for us: https://github.com/apollographql/apollo-client/issues/4170
f
Interesting. Thanks for the links. So what have you been doing instead? Just manually typing your frontend?
s
no great solution yet. i’ve considered taking a look at https://github.com/prisma/graphql-request
imo there should really be a solution that just autogenerates an entire client library based on a schema file like gRPC does. that would automatically solve a lot of these problems
f
@skainswo I actually got that working yesterday with https://github.com/dotansimha/graphql-code-generator
using the
typescript-server
template, ironically enough
s
does graphql-code-generator generate client bindings as well as server ones?