Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 27 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 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-09T09:01:20.000Z (over 4 years ago)
- Last Synced: 2024-11-12T06:35:39.156Z (3 months 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
phone
company
}
}
`)reqBody, _ := gql.Var("id", "b1f6366f-5263-4f9e-864b-dde9af14ea840").GenerateRequestBody()
r, _ := http.NewRequest("POST", GQL_SERVER_URL, reqBody)
```