Files
go-simple-graphql/sample/client.go
T
lukaszraczylo e0913f8824 New minor release after complete rewrite.
Brings neat and testable codebase with minimum allocations in mind.
2023-04-07 15:27:44 +01:00

38 lines
553 B
Go

package main
import (
"fmt"
graphql "github.com/lukaszraczylo/go-simple-graphql"
)
func main() {
gql := graphql.NewConnection()
query := `query MyQuery {
bots {
bot_name
ddd
}
}`
_, err := gql.Query(query, nil, nil)
if err != nil {
fmt.Println("Error returned from query:", err)
}
query = `query MyQuery {
badwords(distinct_on: word) {
word
}
}`
gql.Query(query, nil, nil)
// Repeated to use the cached response
query = `query MyQuery {
badwords(distinct_on: word) {
word
}
}`
gql.Query(query, nil, nil)
}