All Projects → machinebox → Graphql

machinebox / Graphql

Licence: apache-2.0
Simple low-level GraphQL HTTP client for Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Graphql

Graphql Typed Client
A tool that generates a strongly typed client library for any GraphQL endpoint. The client allows writing GraphQL queries as plain JS objects (with type safety, awesome code completion experience, custom scalar type mapping, type guards and more)
Stars: ✭ 194 (-71.55%)
Mutual labels:  graphql, client
Re Graph
A graphql client for clojurescript and clojure
Stars: ✭ 366 (-46.33%)
Mutual labels:  graphql, client
Graphql Flutter
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
Stars: ✭ 2,811 (+312.17%)
Mutual labels:  graphql, client
Subscriptions Transport Sse
A Server-Side-Events (SSE) client + server for GraphQL subscriptions
Stars: ✭ 55 (-91.94%)
Mutual labels:  graphql, client
Graphql
Package graphql provides a GraphQL client implementation.
Stars: ✭ 467 (-31.52%)
Mutual labels:  graphql, client
Graphql client
GraphQL Client.
Stars: ✭ 78 (-88.56%)
Mutual labels:  graphql, client
Graphql Binding
Auto-generated SDK for your GraphQL API (supports schema stitching & codegen)
Stars: ✭ 367 (-46.19%)
Mutual labels:  graphql, sdk
Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (-71.7%)
Mutual labels:  sdk, client
Aliyun Openapi Net Sdk
Alibaba Cloud SDK for .NET
Stars: ✭ 467 (-31.52%)
Mutual labels:  sdk, client
Graphql Client
A GraphQL Client for .NET Standard
Stars: ✭ 418 (-38.71%)
Mutual labels:  graphql, client
Graphql Zeus
GraphQL client and GraphQL code generator with GraphQL autocomplete library generation ⚡⚡⚡ for browser,nodejs and react native
Stars: ✭ 1,043 (+52.93%)
Mutual labels:  graphql, client
Milo
Eclipse Milo™ - an open source implementation of OPC UA (IEC 62541).
Stars: ✭ 587 (-13.93%)
Mutual labels:  sdk, client
Githubv4
Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql).
Stars: ✭ 760 (+11.44%)
Mutual labels:  graphql, client
Graphlient
Ruby GraphQL Client
Stars: ✭ 142 (-79.18%)
Mutual labels:  graphql, client
Openapi Sdk Php Client
Official repository of the Alibaba Cloud Client for PHP
Stars: ✭ 206 (-69.79%)
Mutual labels:  sdk, client
Strapi Sdk Javascript
🔌 Official JavaScript SDK for APIs built with Strapi.
Stars: ✭ 247 (-63.78%)
Mutual labels:  graphql, sdk
Open62541
Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0
Stars: ✭ 1,643 (+140.91%)
Mutual labels:  sdk, client
Meilisearch Js
Javascript client for the MeiliSearch API
Stars: ✭ 183 (-73.17%)
Mutual labels:  sdk, client
Graphql Ws
Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.
Stars: ✭ 398 (-41.64%)
Mutual labels:  graphql, client
Aliyun Cli
Alibaba Cloud CLI
Stars: ✭ 561 (-17.74%)
Mutual labels:  sdk, client

graphql GoDoc Build Status Go Report Card

Low-level GraphQL client for Go.

  • Simple, familiar API
  • Respects context.Context timeouts and cancellation
  • Build and execute any kind of GraphQL request
  • Use strong Go types for response data
  • Use variables and upload files
  • Simple error handling

Installation

Make sure you have a working Go environment. To install graphql, simply run:

$ go get github.com/machinebox/graphql

Usage

import "context"

// create a client (safe to share across requests)
client := graphql.NewClient("https://machinebox.io/graphql")

// make a request
req := graphql.NewRequest(`
    query ($key: String!) {
        items (id:$key) {
            field1
            field2
            field3
        }
    }
`)

// set any variables
req.Var("key", "value")

// set header fields
req.Header.Set("Cache-Control", "no-cache")

// define a Context for the request
ctx := context.Background()

// run it and capture the response
var respData ResponseStruct
if err := client.Run(ctx, req, &respData); err != nil {
    log.Fatal(err)
}

File support via multipart form data

By default, the package will send a JSON body. To enable the sending of files, you can opt to use multipart form data instead using the UseMultipartForm option when you create your Client:

client := graphql.NewClient("https://machinebox.io/graphql", graphql.UseMultipartForm())

For more information, read the godoc package documentation or the blog post.

Thanks

Thanks to Chris Broadfoot for design help.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].