Registry /
http-client / hasura-go-graphql-client
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
graphql
✓ github.com/hasura/go-graphql-client
Execute a GraphQL query using the client.
package main
import (
"context"
"fmt"
"github.com/hasura/go-graphql-client"
)
func main() {
client := graphql.NewClient("https://example.com/graphql", nil)
var query struct {
User struct {
Name string
} `graphql:"user(id: \"1\")"`
}
err := client.Query(context.Background(), &query, nil)
if err != nil {
fmt.Println(err)
}
fmt.Println(query.User.Name)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.16.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.