
Explore GraphQL, a query language and runtime for APIs, and learn how queries, mutations, and schemas enable precise data requests and a contract between client and server.
Build a simple GraphQL API with Express by defining a schema and a root resolver, expose a /graphql endpoint with GraphQL HTTP for a log data source, and enable GraphiQL.
Add a GraphQL mutation to create products with an input type, return a product array, and define a resolver, then explore Apollo GraphQL with Express and TypeScript.
Install the TypeScript compiler with npm, ensuring Node is installed from nodejs.org, then initialize tsconfig.json with tsc --init and set es6, commonjs, and dist.
Explore TypeScript syntax by declaring typed variables, objects, and functions in a TypeScript file. Learn how type annotations, union types, and optional properties prevent runtime errors.
Master advanced TypeScript by using interfaces to model complex objects, employing generic interfaces for login args, and enforcing password and member statuses with type aliases and enums.
Learn to scaffold a GraphQL schema in a Node.js project with Express and Apollo, defining a signup mutation with input and auth response types and tsconfig setup.
Define an auth resolvers object with a signup mutation in an auth/resolvers.ts file, handling async signup via input, parent, and context, and prepare for TypeScript type generation from the schema.
Install GraphQL codegen CLI and plugins, configure codegen.yaml with schema and output paths, generate TypeScript resolver types, and implement a signup resolver with dummy data and a JWT token.
Set up an Apollo Express server that wires GraphQL typedefs from schema.graphql with resolvers, including auth resolvers, using Express and HTTP to expose an Apollo server ready to run.
Build and test a GraphQL gateway with Express and Apollo Server by bootstrapping the app, starting on port 4000, and validating signup and get queries via Apollo Studio.
Learn to set up and configure TypeORM with PostgreSQL in a TypeScript project by installing dependencies, enabling decorators, and wiring reflect-metadata in main.ts and tsconfig.
Create a user entity using TypeORM decorators, defining first name, last name, email, and a password hidden from the client. Use a primary generated column for Postgres IDs.
Create a user service with a signup method that hashes passwords using bcrypt and saves new users via the user repository in a GraphQL with Apollo and Express setup.
Create the app data source in the source folder, configure a local Postgres database via Docker (localhost:5432, admin/admin, main database), and define entities from the dist folder.
Implement the signup resolver by creating a new user from the signup input, generate a JWT with email and user id, and throw a GraphQL error if the user exists.
Define and implement the sign in mutation and input, verify user by email with a query builder, compare passwords with bcrypt, and return a JWT while hiding passwords in GraphQL.
Build a current user query in GraphQL using Apollo and Express, extract a JWT from the authorization header, and populate a context with current user and authorized status.
Docker creates portable, isolated containers—sealed worlds with their own programs—so your NodeJS app runs in the same Linux environment when pulled from Docker Hub.
Install Docker on Linux by removing outdated versions, updating apt, installing required packages, and setting up the Docker engine repository, then verify the installation with the hello world image.
Demonstrate how docker uses images to create isolated containers and run an interactive ubuntu bash session. Show that files created in one container do not appear in another.
Turn a running or stopped Docker container into a reusable image using Docker commit, tag it with a human-friendly name, and verify it with Docker images.
Learn to run a postgres database with docker by pulling the postgres image, launching a container, mapping host port 5455 to 5432, and configuring POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB.
Initialize the app data source to connect to Postgres and expose a test GraphQL endpoint with Apollo and Express, safely handling JWTs in context for resolvers.
Create a Docker image from the app Postgres container, map port 5455 to 5432, and test the GraphQL API in Apollo sandbox after enabling the dash dash m flag.
Define the room schema by modularizing GraphQL files, create room and message types with users and messages, and implement the send message mutation before merging into schema.graphql.
Generate and merge all sub GraphQL schemas into a single schema.graphql file by importing globe, reading .graphql files, merging with graphql tools, and appending the result as a string.
Create the room resolvers file and implement the send message mutation with authorization checks, returning a room containing id, users, and messages for GraphQL endpoint testing.
Combine auth and room resolvers with GraphQL Tools merge package in AppModule to merge multiple resolvers into a single schema, then validate with npm start and Apollo Sandbox.
Define the room entity with typeorm decorators, including a unidirectional many-to-many relation to the user entity via a join table stored as jsonb, and a jsonb messages array.
Create a room service with a repository to persist rooms and initial messages. Then add messages to existing rooms using a query builder to append to a jsonb messages array.
Implement the createRoom resolver end-to-end by wiring the app data source, room service, and repository; define the create room mutation with input validation and user authentication to avoid duplicate rooms.
Describe how the createRoom resolver checks for an existing room by receiver and sender IDs, uses the room service to create it, fetches participants, and sends the message.
Create a get rooms query in the room GraphQL schema and implement the get all rooms resolver with authentication, using the query builder to fetch rooms for the current user.
Test and secure a GraphQL API by running Postgres, starting the server, and using Apollo Sandbox to sign in, create rooms, and send messages with JWT authentication.
Add validation to your project using the class-validator package, applying email and min length decorators to user properties, exploring decorators for URL, array, and case checks, and handling validation errors.
Validate new user data with class-validator before saving, handle validation errors via GraphQL with detailed extensions, hash the password, and return the saved user in the signup flow.
Explore real-time messaging with socket.io, enabling instant delivery of new messages and room updates between web clients and servers without page refresh.
Install socket.io and implement a socket.io server on the http server, listen for connections, and join user rooms by extending the request with the socket.io instance.
Learn to emit a message to a specific socket.io room by passing io instance via context and using to(roomId) before emit with a data object containing message and room ID.
Connects to the server, sends messages via queries and mutations, and listens for connect and message events. Demonstrates jwt token usage from the Apollo sandbox and live server testing.
Learn how to safely migrate a GraphQL API database using migrations, disable automatic synchronize, generate and run migrations, and update schemas without losing user data.
Welcome to The Ultimate GraphQL and Apollo Server Course with Express and TypeScript! This comprehensive course is designed to teach you everything you need to know to build powerful APIs using GraphQL, Apollo Server, Express, and TypeScript.
This course is not meant to teach you everything about GraphQL, but it is meant to teach you how to use GraphQL with Apollo and how to use advanced tools and technologies to build powerful APIs. We start with the basics and gradually build up to advanced topics, so even if you're new to GraphQL and Apollo Server, you'll be able to follow along.
Throughout the course, we'll cover key concepts like queries, mutations, and schemas, but we'll also dive deep into advanced topics like SocketIo, JWT, and database migration with TypeORM. You'll learn how to work with TypeORM and use Postgres with Docker, giving you the tools you need to build scalable and efficient APIs.
We believe that this course is the ultimate resource for developers looking to master GraphQL and Apollo Server with TypeScript and Express. The content is comprehensive, the teaching is clear, and the skills you'll learn are in high demand in the job market.
By the end of the course, you'll have the skills and knowledge to build your own GraphQL API using Apollo Server and Express with TypeScript, as well as advanced features like SocketIo and database migration with TypeORM. You'll also be able to confidently work with GraphQL and Apollo Server in your own projects.
So if you're ready to take your API development skills to the next level, enroll now for The Ultimate GraphQL and Apollo Server Course with Express and TypeScript today!