...

Package graphql

import "github.com/shurcooL/graphql"
Overview
Index
Subdirectories

Overview ▾

Package graphql provides a GraphQL client implementation.

For more information, see package github.com/shurcooL/githubv4, which is a specialized version targeting GitHub GraphQL API v4. That package is driving the feature development.

For now, see README for more details.

type Boolean

Boolean represents true or false values.

type Boolean bool

func NewBoolean

func NewBoolean(v Boolean) *Boolean

NewBoolean is a helper to make a new *Boolean.

type Client

Client is a GraphQL client.

type Client struct {
    // contains filtered or unexported fields
}

func NewClient

func NewClient(url string, httpClient *http.Client) *Client

NewClient creates a GraphQL client targeting the specified GraphQL server URL. If httpClient is nil, then http.DefaultClient is used.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m interface{}, variables map[string]interface{}) error

Mutate executes a single GraphQL mutation request, with a mutation derived from m, populating the response into it. m should be a pointer to struct that corresponds to the GraphQL schema.

func (*Client) Query

func (c *Client) Query(ctx context.Context, q interface{}, variables map[string]interface{}) error

Query executes a single GraphQL query request, with a query derived from q, populating the response into it. q should be a pointer to struct that corresponds to the GraphQL schema.

type Float

Float represents signed double-precision fractional values as specified by IEEE 754.

type Float float64

func NewFloat

func NewFloat(v Float) *Float

NewFloat is a helper to make a new *Float.

type ID

ID represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

type ID interface{}

func NewID

func NewID(v ID) *ID

NewID is a helper to make a new *ID.

type Int

Int represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

type Int int32

func NewInt

func NewInt(v Int) *Int

NewInt is a helper to make a new *Int.

type String

String represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.

type String string

func NewString

func NewString(v String) *String

NewString is a helper to make a new *String.

Subdirectories

Name Synopsis
..
example
graphqldev graphqldev is a test program currently being used for developing graphql package.
ident Package ident provides functions for parsing and converting identifier names between various naming convention.