DEV Community

Takahiro Kudo
Takahiro Kudo

Posted on

3 3

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

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay