Lab 10: GraphQL TypeScript
Step 1: Environment Setup
docker run -it --rm node:20-alpine sh
npm install -g typescript ts-node
mkdir lab10 && cd lab10
npm init -y
npm install type-graphql graphql reflect-metadata class-validator
echo '{
"compilerOptions": {
"module": "commonjs",
"target": "ES2020",
"strict": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true
}
}' > tsconfig.jsonStep 2: ObjectType — Define GraphQL Types
Step 3: Input Types and Validation
Step 4: Resolvers — Queries
Step 5: Building and Executing the Schema
Step 6: Custom Scalars
Step 7: Field Resolvers and Context
Step 8: Capstone — Complete Schema Execution
Summary
Decorator
Purpose
Example
Last updated
