Creating a fullstack Serverless App Template
May 26, 2020
I created a template that will enable developers to quickly bootstrap an Apollo GraphQL + TypeScript project, which can be deployed in a serverless fashion on Netlify. Also, with the FaunaDB addon, it will enable developers to have a stateful app. Thus, developers can concentrate on core application logic and scale the application as their app grows at the same time they don’t have to sacrifice on security.
Netlify functions enable developers to deploy lambda functions. They have a template for Apollo GraphQL as well. However, this template doesn’t support TypeScript. Limiting the advantages of GraphQL to just querying and mutating data. Having TypeScript helps developers to change code with reliability. This also enhances overall experience with GraphQL as schema defined in GraphQL can be directly exported to TypeScript types.
For such cases, Netlify recommends using legacy command
netlify-lambda command. But people ran into other
issues using it. However, I integrated TypeScript in the build process instead and so didn’t need to use
I further integrated
graphql-codegen to automatically generate TypeScript types for GraphQL schema.
And also integrated
husky to introduce lint checks and validate them before each commit.
I created a demo project using this template and also integrated FaunaDB addon on GitHub.
developer in India.