The newline Guide to Building Your First GraphQL Server with Node and TypeScript

In this course, we'll show you how to create your first GraphQL server with Node.js and TypeScript

 

What You Will Learn

How to create a Node server using Express

Importance of strongly-typed code

How to integrate TypeScript to a Node server

Differences between REST & GraphQL

What problems GraphQL can solve

How to create a GraphQL API using Apollo

In this course, we'll be creating a Node server from scratch with the help of the Express framework. We'll then introduce the benefits of strongly-typed code and integrate TypeScript into our Node server application.

We will compare GitHub's old RESTful API against its new GraphQL API. We will explore the problems GraphQL aims to solve. And finally, we will create our own GraphQL API using Apollo!

Course Content

4 modules25 lessons2h 34m total

Introduction

2 lessons 5m total

Welcome!

Introduction to the Newline guide to building your first GraphQL server with Node and TypeScript.

INTRODUCTION

2:56 minutes

Environment Setup

Quick walkthrough of the development environment and tools used in the course.

INTRODUCTION

2:53 minutes

Getting Started With Our Node Server

12 lessons1h 21m total

Module 1 Introduction

This is an introduction to the work we'll be doing in Module 1.0.

INTRODUCTION

1:03 minutes

What is Node?

Node is a JavaScript runtime environment that was first introduced in 2009 by Ryan Dahl, as a response to how slow web servers were at the time. In this lesson, we'll introduce Node and talk about the capability Node provides to make I/O tasks asynchronous and non-blocking.

LESSON

5:05 minutes

Running JavaScript with Node

In this lesson, we'll use Node to run a simple JavaScript file on the server.

LESSON

2:58 minutes

Creating a minimal Node:Express Server

Web servers provide functionality for requests that can be made from client applications. Node has a built-in HTTP module to allow for building a server that facilitates the transfer of data in HTTP. With this lesson, we'll look to use the popular Express framework as the replacement of the core HTTP module to create a minimal Node server, with Express routing.

LESSON

8:07 minutes

Automatic Reloading Using Nodemon

Nodemon is an open-source utility tool that helps automatically restart a Node server whenever a change in code is detected in development. In this lesson, we'll install Nodemon and introduce an application script that will start the Node server with Nodemon.

LESSON

3:49 minutes

Introducing TypeScript

JavaScript is considered a weakly typed language. In this lesson, we'll go through a simple example of why that can be an issue in development and where TypeScript falls in the picture.

LESSON

5:37 minutes

Adding TypeScript to our Server

We'll get started with TypeScript in this lesson by installing a few necessary packages in our server and setting up the configuration of our TypeScript compiler.

LESSON

16:10 minutes

Compiling our TypeScript project

TypeScript is a development tool geared towards making building JavaScript applications more robust. In an application's deployed state (browser or server), TypeScript must be compiled to valid JavaScript. In this lesson, we'll see how the TypeScript compiler provides us with a command to compile and produce JavaScript code from TypeScript.

LESSON

3:05 minutes

Linting with ESLint

Though VSCode includes TypeScript language support which helps us pick up TypeScript errors in our TypeScript code, we'll introduce more robust code checking with ESLint - a popular open-source JavaScript/TypeScript linting tool.

LESSON

13:17 minutes

Introducing mock listings

To help us get started, we'll begin by introducing a mock data array of rental listings in this lesson. This will help us get started before we begin to address more appropriate data persistence.

LESSON

7:03 minutes

Creating GET and POST Express routes

In this lesson, we'll use the routing capabilities Express gives us to create GET and POST routes that interact with the mock data array we've established.

LESSON

10:45 minutes

Module 1 Summary

This lesson is a summary of the work we've done in Module 1.0.

LESSON

4:03 minutes

Comparing REST & GraphQL APIs

4 lessons 27m total

Module 2 Introduction

Introduction to Module 2.0.

INTRODUCTION

0:42 minutes

What is GraphQL?

GraphQL is a query language for APIs. In this lesson, we go through an initial discussion on GraphQL and how GraphQL differs from traditional REST APIs.

LESSON

5:40 minutes

Comparing Github's REST and GraphQL APIs

Before we continue discussing some of the core concepts in GraphQL, we'll take a bit of a tangent in this lesson to contrast and compare Github's existing REST API (v3) and their GraphQL API (v4).

LESSON

9:47 minutes

GraphQL Concepts

In this lesson, we introduce and discuss some of GraphQL's main concepts such as the GraphQL schema, object types and resolver functions.

LESSON

11:22 minutes

Using Apollo Server To Create The GraphQL API

6 lessons 37m total

Module 3 Introduction

Introduction to Module 3.0.

INTRODUCTION

1:00 minutes

Installing Apollo Server and GraphQL

In this lesson, we'll install the Express variation of the popular Apollo Server library and the GraphQL JavaScript library.

LESSON

2:05 minutes

Creating a GraphQL Schema with the GraphQL JS Library

In this lesson, we'll use the Apollo Server and GraphQL JavaScript libraries to create a minimal GraphQL API that we'll be able to interact within an IDE known as GraphQL Playground.

LESSON

9:28 minutes

Querying and mutating listings data with GraphQL

In this lesson, we'll look to mimic the listings retrieval and manipulation we had in our Express RESTful API but with GraphQL instead.

LESSON

11:33 minutes

Using the GraphQL Schema Language

The GraphQL schema language is a human-readable syntax to help create GraphQL schemas. In this lesson, we'll use the GraphQL schema language to re-create the schema we have in a more readable and simpler format.

LESSON

10:51 minutes

Module 3 Summary

This lesson is a summary of the final state of the work done in Module 3.0.

LESSON

2:06 minutes

Conclusion

1 lesson 2m total

Continue the course with TinyHouse

Enroll in TinyHouse to continue the course!

INTRODUCTION

2:36 minutes

Your Instructors

djirdehh

Hassan Djirdeh

Front End Developer @Shopify | Creator of TinyHouse | Author of Fullstack Vue

👋 Hi! I'm Hassan. You may recognize me from the TinyHouse Masterclass, Fullstack Vue, or from other publications I’ve made under the newline brand. I'm a Front-End/Web Engineer at Shopify where I've been working with React, TypeScript, and GraphQL for years now to help build some of the largest production applications at-scale.

Jing

Jing Chen

👋 Hi! I'm Jing, the co-creator of this course. I'm a web developer/instructor, and I've used Node, Express, and GraphQL to build numerous web applications.

Frequently Asked Questions

Who is this course for?

This course is for anybody looking to understand how to spin up a GraphQL API within a Node/TypeScript environment. If you’ve never done web development before, this is a great place to start!

Why is this course free?

We wanted create a super simple course & boilerplate for anyone looking to start building GraphQL APIs with some of the most popular tech stacks.

What if I need help?

You can ask us questions anytime through the community Discord channel (#tinyhouse) or by sending us a message.

Free

$99

  • Learn about GraphQL

  • Build a GraphQL Server in Node.js

  • Integrate TypeScript to Node.js

  • 25 lessons (2h 34m)

  • 1 complete project

  • 1,035 lines of code

The newline Guide to Building Your First GraphQL Server with Node and TypeScript - Free

Free

$99