simple-graphql-go

command module
v0.0.0-...-e9e1c72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2023 License: MIT Imports: 6 Imported by: 0

README

simple-graph-ql


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
  }
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL