Documentation
¶
Overview ¶
Package graphql provides support for executing mutations and queries against a database using GraphQL. It was designed specifically for working with [Dgraph](https://dgraph.io/) and has some Dgraph specific support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithClient ¶ added in v1.4.4
WithClient adds a custom client for processing requests.
func WithHeader ¶ added in v1.4.4
WithHeader adds a key value pair to the header for requests.
func WithVariable ¶ added in v1.5.0
WithVariable allows for the submission of variables to the query.
Types ¶
type GraphQL ¶
type GraphQL struct {
// contains filtered or unexported fields
}
GraphQL represents a system that can accept a graphql query.
func New ¶
New constructs a GraphQL for use to making queries agains a specified host. The url is the fully qualifying URL without the /graphql path.
func (*GraphQL) Query ¶
func (g *GraphQL) Query(ctx context.Context, queryString string, response interface{}, variables ...func(m map[string]interface{})) error
Query performs a GraphQL query against the configured server.
func (*GraphQL) QueryEndpoint ¶ added in v1.5.1
func (g *GraphQL) QueryEndpoint(ctx context.Context, endpoint string, queryString string, response interface{}, variables ...func(m map[string]interface{})) error
QueryEndpoint performs a GraphQL query against the configured server at the specified endpoint from the base URL.