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/).
Index ¶
- Constants
- func WithAuth(authHeaderName string, authToken string) func(gql *GraphQL)
- type GraphQL
- func (g *GraphQL) Do(ctx context.Context, command string, r io.Reader, response interface{}) error
- func (g *GraphQL) Query(ctx context.Context, queryString string, response interface{}) error
- func (g *GraphQL) QueryPM(ctx context.Context, queryString string, response interface{}) error
- func (g *GraphQL) QueryWithVars(ctx context.Context, command string, queryString string, ...) error
Constants ¶
View Source
const ( CmdAdmin = "admin" CmdQuery = "graphql" CmdQueryPM = "query" )
These commands represents the set of know graphql commands.
Variables ¶
This section is empty.
Functions ¶
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) Do ¶ added in v1.4.1
Do provides the mechanics of handling a GraphQL request and response.
Click to show internal directories.
Click to hide internal directories.