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/cli/shurcooL-graphql
Execute a GraphQL query to fetch the current user's login name.
package main
import (
"context"
"github.com/cli/shurcooL-graphql"
"log"
)
func main() {
client := graphql.NewClient("https://api.github.com/graphql", nil)
var query struct {
Viewer struct {
Login string
}
}
err := client.Query(context.Background(), &query, nil)
if err != nil {
log.Fatal(err)
}
log.Printf("Logged in as: %s\n", query.Viewer.Login)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.4latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.