4 ms·
We've actually gone the opposite direction. We start with our GraphQL schema and then generate TypeScript types off of that schema. This is something that's oft
by adamkl 8y ago
We've actually gone the opposite direction. We start with our GraphQL schema and then generate TypeScript types off of that schema. This is something that's often done on the client side, but we do it on the server side.
With those, we get type safety on input arguments, and can make sure that our data access layer maps from back-end data sources to our output GraphQL types.
- ex3ndr 8y agoCan you share what exactly you are generating for server? Asking for a friend :)
- adamkl 8y agoWe actually built an internal tool (shamelessly called create-graphql-service) that scaffolds a new graphql service and includes generation of TypeScript types as part of the build process [1]. [1] https://gist.github.com/adamkl/27539b3a8129f23e3576bfc37b3ea235 https://gist.github.com/adamkl/27539b3a8129f23e3576bfc37b3ea...