Documentation ¶
Index ¶
- type Boolean
- type Client
- func (c *Client) Mutate(ctx context.Context, m any, variables map[string]any) error
- func (c *Client) MutateNamed(ctx context.Context, queryName string, m any, variables map[string]any) error
- func (c *Client) Query(ctx context.Context, q any, variables map[string]any) error
- func (c *Client) QueryNamed(ctx context.Context, queryName string, q any, variables map[string]any) error
- type Errors
- type Float
- type ID
- type Int
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boolean ¶
type Boolean bool
Boolean represents true or false values.
func NewBoolean ¶
NewBoolean is a helper to make a new *Boolean.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a GraphQL client.
func NewClient ¶
NewClient creates a GraphQL client targeting the specified GraphQL server URL. If httpClient is nil, then http.DefaultClient is used.
func (*Client) Mutate ¶
Mutate executes a single GraphQL mutation request, with a mutation derived from m, populating the response into it. Argument m should be a pointer to struct that corresponds to the GraphQL schema.
func (*Client) MutateNamed ¶
func (c *Client) MutateNamed(ctx context.Context, queryName string, m any, variables map[string]any) error
MutateNamed is the same as Mutate but allows a name to be specified for the mutation.
type Errors ¶ added in v0.0.3
type Errors []struct { Message string Locations []struct { Line int Column int } Path []any Extensions map[string]any Type string }
Errors represents the "errors" array in a response from a GraphQL server. If returned via error interface, the slice is expected to contain at least 1 element.
Specification: https://spec.graphql.org/October2021/#sec-Errors.
type Float ¶
type Float float64
Float represents signed double-precision fractional values as specified by IEEE 754.
type ID ¶
type ID any
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.
Directories ¶
Path | Synopsis |
---|---|
Package ident provides functions for parsing and converting identifier names between various naming convention.
|
Package ident provides functions for parsing and converting identifier names between various naming convention. |
internal
|
|
jsonutil
Package jsonutil provides a function for decoding JSON into a GraphQL query data structure.
|
Package jsonutil provides a function for decoding JSON into a GraphQL query data structure. |