Welcome, Getting Started

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


👩‍💻 Get access to the source code for this course - here.
🎳 Join us over at the #tinyhouse channel in our Discord organization - here.

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

This course contains three core modules (i.e. chapters) that introduce and explain specific topics.

Module 1 - Getting Started With Our Node Server

In Module 1, we'll be creating a Node server from scratch with the help of the Express framework. We'll then introduce the benefits of TypeScript and integrate TypeScript into our Node server application.

For the details within this module:

  • We'll introduce Node and explain how Node is different to other web server technologies.
  • Run a simple JavaScript file with Node.
  • Create a server with the help of the popular Express package.
  • Use Nodemon as a development tool to help with automatic reloading of our code.
  • Introduce TypeScript and explain the benefits of using it.
  • Add TypeScript to our server project and see how we're able to compile a TypeScript project to valid JavaScript.
  • Install and use ESLint as our development code linting tool.
  • Finally, use mock data to create a GET and POST route within our server to mimic how RESTful APIs are to usually behave.

Module 2 - Comparing REST & GraphQL APIs

By the end of Module 1 - we would have created a RESTful API to interact with our mock data. A common question at this point would be, why would one need GraphQL?

GraphQL is a query language for APIs and was originally created to help client-side applications dictate the data they need before they request it. We thought the best way to introduce GraphQL would be to compare a real REST and GraphQL API that achieves the same outcome.

In this module, we'll:

Module 3 - Comparing REST & GraphQL APIs

By the end of Module 2, we will have an understanding of how GraphQL is a typed query language that allows client-side applications to request the data they want. With that said, how would one go about creating a GraphQL API?

GraphQL is a specification, not a direct implementation. This means GraphQL can be implemented in multiple programming languages. In our case, we'll be using Apollo to create our API.

In particular, we'll be using the Apollo Server package, which is the server package within the Apollo ecosystem. Apollo Server allows us to create a production-ready, self-documenting, GraphQL API in Node applications. It's really easy to get started with and incrementally adoptable.

In this module, we'll:

  • Install Apollo Server and the GraphQL JavaScript library.
  • Create a GraphQL Schema.
  • Build GraphQL resolver functions to interact with our mock data.
  • Finally, recreate our schema with the much simpler GraphQL Schema Language.

If you have any questions, don't hesitate to reach out to us in our Discord channel - #tinyhouse!


Hassan, Jing, and Nate

Start a new discussion. All notification go to the author.