command
module
Version:
v0.0.0-...-4b43d43
Opens a new window with list of versions in this module.
Published: Dec 15, 2018
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
graphql-go-demo
A Graphql server demo built in Go using (graphql/graphql-go)[https://github.com/graphql-go/graphql].
The server is backed by a mysql database and exposes Post
and Comment
models
Installation
Clone this repository
git clone https://github.com/zianwar/go-graphql-demo
Install dependencies
go get ./...
Database configuration
-
Run the SQL query in the up.sql
file.
-
Update the credentials in main.go
to match your database config
The default config ones are:
Host: localhost
User: root
Password: ''
Db Name: graphqlgodemo
Usage
Start the server using: go build && ./graphql-go-demo
.
You can try these queries:
-
Get titles of all posts
query {
posts {
title
}
}
-
Get titles of all posts and their comments
query {
posts {
title
comments {
body
}
}
}
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.