This repository hosts the implementation of a GraphQL API based on RESTful Blog API, ensuring maximum optimization for queries and mutations. Additionally, the GraphQL N+1 problem is addressed using DataLoader.
Throughout the development process, only GraphQL and DataLoader dependencies are used, adhering to the project's strict dependency requirements.
-
Clone this repository.
-
Install dependencies
npm install
. -
Create
.env
file (based on.env.example
):cp .env.example .env
-
Create database file, apply migrations and seed the initial data:
touch prisma/database.db && npx prisma migrate deploy && npx prisma db seed
-
Run server:
npm run start
# queries
npm run test-queries
# mutations
npm run test-mutations
# complexity of the graphql queries
npm run test-rule
# n+1 graphql problem
npm run test-loader
npm run test-loader-prime