command
module
Version:
v0.0.0-...-ac9c94f
Opens a new window with list of versions in this module.
Published: Mar 4, 2023
License: MIT
Opens a new window with license information.
Imports: 19
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
learning-graphql
初めてのGraphQLの勉強用リポジトリです。
第5章を書籍ではjsですが、Goで書き換えています。
参考にしたサイト
【GraphQL × Go】gqlgenの基本構成とオーバーフェッチを防ぐmodel resolverの実装
環境構築
事前準備
gqlgenのinstall
gqlgenを利用しています
以下コマンドでgqlgenをinstallしてください
go install github.com/99designs/gqlgen
環境変数設定
.env.sample
を.env
とし、環境変数を設定してください
サービス起動
docker compose up -d
でサービスが起動します。
サービスとその役割は以下です。
- graphql-server
- graphqlのサーバーです(websocketも対応)
localhost:8080
でplaygroundが起動しgraphqlを叩けます
- mongo
- mongo-express
- GUIでmongo-dbを見れるサービスです
localhost:8081
でアクセスできます
スキーマ変更方法
-
./graph/schema.graphqls
を編集
-
rootディレクトリにてmake gqlgen
を実行する
以下ファイルが自動生成されます
- ./graph/model/models_gen.go
- ./graph/generated.go
- ./graph/schema.resolver.go
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
app
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.