go mod init github.com/xcheng85/simple-graphql-go
go get github.com/99designs/gqlgen
go run github.com/99designs/gqlgen init
go get github.com/99designs/gqlgen/graphql/handler
# after graphql schema is updated
go get github.com/99designs/gqlgen@v0.17.30
go run github.com/99designs/gqlgen generate
# for advanced graphql schema
https://github.com/99designs/gqlgen/tree/master/_examples
query{
players(){
id
}
}
//enum input has no ""
mutation {
addPlayer(player: {First: "Roger", Last: "Federer", Country: SWISS, Gender: MALE}){
id
}
}
mutation {
addPlayer(player: {First: "Rafael", Last: "Nadal", Country: SPAIN, Gender: MALE}){
id
}
}
mutation ($first: String!){
addPlayer(player: {First: $first, Last: "Federer", Country: SWISS, Gender: MALE}){
id
}
}
variables:
{
"first": "Roger"
}
query{
player(id:0){
id
First
Last
Country
Gender
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
License
xcheng85/simple-graphql-go
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published