Getting Started
Setup
Clone the repo and install dependencies
# install dependencies
npm install -g serverless
npm installUseful commands
npm run debug
npm run debugThis is the command we use daily. Underlying, it runs sls ofline and graphql-codegen concurrently. Everytime a typescript file changes, the whole project will be recompiled with webpack. Everytime a graphql file changes, graphql-codegen will run to generate new version of types.d.ts file.
npm run test
npm run testRun all the test files in the project with jest.
npm run generate
npm run generateThis command is used to generate types files at src/__generate__/types.d.ts. Normally, when you conduct daily development, you don't want to manually run this command sperately, as this code generation is run automatically.
npm run deploy
npm run deployWhen you completed one feature or fix one bug, you can then push the change to the AWS lambda function service, and all teams will the new version of APIs.
Development Workflow
Design Data Models
Define
GraphQLschema, including type definitions and resolversGenerate type definition file with
graphql-code-genertortool and implement resolvers.Write tests
Deploy via Github Action
Last updated
Was this helpful?