https://github.com/ibreakthecloud/gql-payload
GraphQL request body builder :muscle: for Go clients
https://github.com/ibreakthecloud/gql-payload
client golang graphql hacktoberfest query variable
Last synced: 24 days ago
JSON representation
GraphQL request body builder :muscle: for Go clients
- Host: GitHub
- URL: https://github.com/ibreakthecloud/gql-payload
- Owner: ibreakthecloud
- Created: 2020-09-08T13:42:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T14:20:19.000Z (over 1 year ago)
- Last Synced: 2025-02-28T14:46:54.779Z (over 1 year ago)
- Topics: client, golang, graphql, hacktoberfest, query, variable
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# GQL Payload
gql-payload returns the request body for the provided query or mutation in Go. It is the strip down version of go based gql-client client only till query builder.
### Example:
**Query**
```go
gql := gql.NewField(`
query GetUserByID($id: String!) {
getUser (id:$id) {
name
email
phone
company
}
}
`)
reqBody, _ := gql.Var("id", "b1f6366f-5263-4f9e-864b-dde9af14ea840").GenerateRequestBody()
r, _ := http.NewRequest("POST", GQL_SERVER_URL, reqBody)
```