{"id":13499486,"url":"https://github.com/machinebox/graphql","last_synced_at":"2025-12-25T05:46:59.637Z","repository":{"id":27335698,"uuid":"113361906","full_name":"machinebox/graphql","owner":"machinebox","description":"Simple low-level GraphQL HTTP client for Go","archived":false,"fork":false,"pushed_at":"2024-01-24T22:57:01.000Z","size":59,"stargazers_count":919,"open_issues_count":35,"forks_count":211,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-02-19T15:39:36.104Z","etag":null,"topics":["client","godoc","golang","graphql","machinebox","sdk"],"latest_commit_sha":null,"homepage":"https://blog.machinebox.io/a-graphql-client-library-for-go-5bffd0455878","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/machinebox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-06T20:04:19.000Z","updated_at":"2024-06-01T23:56:33.833Z","dependencies_parsed_at":"2024-01-13T19:24:30.558Z","dependency_job_id":"6d823dcc-5528-41ca-8600-094728e7b252","html_url":"https://github.com/machinebox/graphql","commit_stats":{"total_commits":59,"total_committers":9,"mean_commits":6.555555555555555,"dds":"0.23728813559322037","last_synced_commit":"3a92531802258604bd12793465c2e28bc4b2fc85"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinebox%2Fgraphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinebox%2Fgraphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinebox%2Fgraphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinebox%2Fgraphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machinebox","download_url":"https://codeload.github.com/machinebox/graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213424247,"owners_count":15585272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","godoc","golang","graphql","machinebox","sdk"],"created_at":"2024-07-31T22:00:33.585Z","updated_at":"2025-12-25T05:46:59.631Z","avatar_url":"https://github.com/machinebox.png","language":"Go","readme":"# graphql [![GoDoc](https://godoc.org/github.com/machinebox/graphql?status.png)](http://godoc.org/github.com/machinebox/graphql) [![Build Status](https://travis-ci.org/machinebox/graphql.svg?branch=master)](https://travis-ci.org/machinebox/graphql) [![Go Report Card](https://goreportcard.com/badge/github.com/machinebox/graphql)](https://goreportcard.com/report/github.com/machinebox/graphql)\n\nLow-level GraphQL client for Go.\n\n* Simple, familiar API\n* Respects `context.Context` timeouts and cancellation\n* Build and execute any kind of GraphQL request\n* Use strong Go types for response data\n* Use variables and upload files\n* Simple error handling\n\n## Installation\nMake sure you have a working Go environment. To install graphql, simply run:\n\n```\n$ go get github.com/machinebox/graphql\n```\n\n## Usage\n\n```go\nimport \"context\"\n\n// create a client (safe to share across requests)\nclient := graphql.NewClient(\"https://machinebox.io/graphql\")\n\n// make a request\nreq := graphql.NewRequest(`\n    query ($key: String!) {\n        items (id:$key) {\n            field1\n            field2\n            field3\n        }\n    }\n`)\n\n// set any variables\nreq.Var(\"key\", \"value\")\n\n// set header fields\nreq.Header.Set(\"Cache-Control\", \"no-cache\")\n\n// define a Context for the request\nctx := context.Background()\n\n// run it and capture the response\nvar respData ResponseStruct\nif err := client.Run(ctx, req, \u0026respData); err != nil {\n    log.Fatal(err)\n}\n```\n\n### File support via multipart form data\n\nBy default, the package will send a JSON body. To enable the sending of files, you can opt to\nuse multipart form data instead using the `UseMultipartForm` option when you create your `Client`:\n\n```\nclient := graphql.NewClient(\"https://machinebox.io/graphql\", graphql.UseMultipartForm())\n```\n\nFor more information, [read the godoc package documentation](http://godoc.org/github.com/machinebox/graphql) or the [blog post](https://blog.machinebox.io/a-graphql-client-library-for-go-5bffd0455878).\n\n## Thanks\n\nThanks to [Chris Broadfoot](https://github.com/broady) for design help.\n","funding_links":[],"categories":["Libraries","Go"],"sub_categories":["Go Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinebox%2Fgraphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachinebox%2Fgraphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinebox%2Fgraphql/lists"}