GraphQL Application Initial Setup


This application is created with the Go programming language and with some additional libraries. The libraries that are used in this project are:

  • gqlgen: Used for creating a server with its handler.
  • UUID: Used for creating an ID for data or records inside the storage.

Initialize the project

You may use the following commands to initialize the project if you have to set it up on a local machine. However, it has already been set up for you on the Educative platform.

go mod init domain_name/username/project_name

This is an example of initializing the project command.

go mod init

After the project is initialized, install the following libraries.

go get
go get

Initialize the application

Initialize the GraphQL application with this command.

go run init

Define the schema

The schema.graphqls contains the schema definition for the GraphQL application that contains the default schema for the application. We define the schema for the blog application in that file.

Get hands-on with 1200+ tech skills courses.