Discover Packages
github.com/zianwar/graphql-go-demo
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 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
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
}
}
}
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.