graphql: Index | Files | Directories

package graphql

import ""

Package graphql provides a GraphQL client implementation.

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

Status: In active early research and development. The API will change when opportunities for improvement are discovered; it is not yet frozen.

For now, see README for more details.


Package Files

doc.go graphql.go query.go scalar.go

type Boolean Uses

type Boolean bool

Boolean represents true or false values.

func NewBoolean Uses

func NewBoolean(v Boolean) *Boolean

NewBoolean is a helper to make a new *Boolean.

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client is a GraphQL client.

func NewClient Uses

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 Uses

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 Uses

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 Uses

type Float float64

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

func NewFloat Uses

func NewFloat(v Float) *Float

NewFloat is a helper to make a new *Float.

type ID Uses

type ID interface{}

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.

func NewID Uses

func NewID(v ID) *ID

NewID is a helper to make a new *ID.

type Int Uses

type Int int32

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

func NewInt Uses

func NewInt(v Int) *Int

NewInt is a helper to make a new *Int.

type String Uses

type String 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.

func NewString Uses

func NewString(v String) *String

NewString is a helper to make a new *String.


example/graphqldevgraphqldev is a test program currently being used for developing graphql package.
identPackage ident provides functions for parsing and converting identifier names between various naming convention.
internal/jsonutilPackage jsonutil provides a function for decoding JSON into a GraphQL query data structure.

Package graphql imports 12 packages (graph) and is imported by 3 packages. Updated 2019-01-01. Refresh now. Tools for package owners.