A nearly production ready implementation of a GraphQL server incorporating industry best practices.
✅ Well designed schema with reusable objects.
✅ Standard authorization: Users can only modify products for their own shop, etc.
✅ Field level authorization: Only admins and shop owners can see the shop's address, Only admins and the user can see the user's date of birth.
✅ Malicious query protection: Queries beyond certain depth are rejected.
✅ Data loader pattern to prevent n+1 query problem.
✅ Relay compliant pagination.
✅ Input limit validation.
✅ Robust error handling.
✅ 100% type safety with TypeScript and graphql-codegen.
- Complete authentication solution. I built just enough so users can sign in.
- Highly optimized SQL queries.
- The GraphQL server is embedded within a Next.js route for easy hosting with Vercel
- Introspection and playground is enabled so that visitors can play around with the playground.
- Checkout the project
- Run
npm install
- Copy
.env.example
to.env
- Run
npm run dev
and you're good to go