faruqii / Go-GraphQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install Dependencies

$ go mod tidy

How To run

$ go run ./cmd/main.go

How To test

Url: http://localhost:3000/graphql

POST

{
  "query": "mutation createBook($title: String!, $author: String!, $year: Int!, $publisher: String!) {\n  createBook(title: $title, author: $author, year: $year, publisher: $publisher) {\n    id\n    title\n    author\n    year\n    publisher\n  }\n}",
  "variables": {
    "title": "Book 1",
    "author": "Author 1",
    "year": 2021,
    "publisher": "Publisher 1"
  }
}

GET

http://localhost:3000/graphql?query={books{title, author, year, publisher}}

About


Languages

Language:Go 100.0%