Go GraphQL: Introduction to building GraphQL API in Golang #1

This is the first tutorial of the tutorial series, lets understand what we will be building in this tutorial series & prerequisite

Welcome! This tutorial guides you through building a fully-featured GraphQL-server from scratch. We will be building an example that's closer to "Real World", complete with authentication, pagination, and more.

If you are new to the GraphQL, it is recommended that you go through below tutorial to understand the concepts of GraphQL before starting this tutorial series : A Comprehensive Guide to Learn GraphQL & Its Core Concepts with examples

Note: The final project for this tutorial can be found on GitHub. You can always use it as a reference whenever you get lost throughout the course of the following chapters.


Ready? Let's dive in! 🚀
. . .

Overview

GraphQL is the rising star of backend technologies. It replaces REST as an API design paradigm and is becoming the new standard for exposing the data and functionality of a server.

In this tutorial, you’ll learn how to build an idiomatic GraphQL server entirely from scratch. You are going to use the following technologies:
  • graphql-go/graphql : Fully-featured GraphQL server with a focus on easy setup, performance & great developer experience
  • dgrijalva/jwt-go for handling the JWT authentication in our application
  • GraphQL Playground: “GraphQL IDE” that allows to interactively explore the functionality of a GraphQL API by sending queries and mutations to it.

What to expect

The goal of this tutorial is to build an API for Star Wars. Here is a quick rundown of what to expect in this tutorial.

You’ll start by learning the basics of how a GraphQL server works, simply by defining a GraphQL schema for the server and writing corresponding resolver functions. In the beginning, these resolvers will only work with data that are stored in memory - so nothing will be persisted beyond the runtime of the server.

For simplicity, we will not add a database layer however you can add a database layer later on.

You’ll start by implementing signup/login functionality that enables users to authenticate against the API. This will also allow you to check the permissions of your users for certain API operations.

The next part of the tutorial is about adding realtime functionality to your API using GraphQL subscriptions.

Lastly, you’ll allow the consumers of the API to constrain the list of items they retrieve from the API by adding filtering and pagination capabilities to it.

complete list of chapters in this tutorial series can be found below:
. . .

Prerequisites

This tutorial assumes that you're familiar with both Go & GraphQL. If you need to brush up on GraphQL, we recommend going through the tutorial.

Let’s get started 🚀
. . .

Never miss a post from Gufran Mirza, when you sign up for Ednsquare.