Skip to content

ibreakthecloud/gql-payload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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)

About

GraphQL request body builder 💪 for Go clients

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages