Note: graphql-go Tutorial

takakd

Takahiro Kudo

Posted on March 21, 2021

Note: graphql-go Tutorial

I did graphql-go Tutorial and had a little trouble. Therefore I share my note.

Getting started

https://www.howtographql.com/graphql-go/1-getting-started/

validation failed: packages.Load error occured.
To fix it, setup go module.

% cd <project dir>
% go mod init
% go get github.com/99designs/gqlgen

# This module is needed.
% go get github.com/vektah/gqlparser/v2

%gqlgen init
Enter fullscreen mode Exit fullscreen mode

Database

https://www.howtographql.com/graphql-go/4-database/

server.go needs go-chi.

% go get github.com/go-chi/chi
Enter fullscreen mode Exit fullscreen mode

Testing query and mutation.

We can test on browser UI which URL is http://localhost:8080.

Codes

https://github.com/takakd/graphql-go-tutorial

💖 💪 🙅 🚩
takakd
Takahiro Kudo

Posted on March 21, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related