Skip to content

axetroy/graphql

Repository files navigation

Simple GraphQL Client for Go

License

Usage

go get -v github.com/axetroy/graphql
package main

import (
  "github.com/axetroy/graphql"
  "fmt"
)

func main() {
  client := graphql.New("http://0.0.0.0:9066/api/graphql")
  if res, err := client.Run(graphql.Request{
    OperationName: "posts",
    Query: `
query posts {
  public {
    posts(query: {limit: 10, page: 0}) {
      data {
        id
      }
    }
  }
}
`,
    Variables: graphql.Variables{
      "v": graphql.Variables{
        "key": "value",
      },
    },
  }); err != nil {
    panic(err)
  } else {
    fmt.Println(res.Data)
    fmt.Println(res.Errors)
  }
}

Contributing

Contributing Guid

Contributors


Axetroy

💻 🐛 🎨

License

FOSSA Status

About

Simple GraphQL Client for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages