client

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(url string, httpClient graphql.Doer) *client

NewClient creates a new custom graphql client

Types

type Client

type Client interface {
	Query(ctx context.Context, q interface{}, variables map[string]interface{}, options ...graphql.Option) error
	QueryRaw(ctx context.Context, q any, variables map[string]any, options ...graphql.Option) ([]byte, error)
	Mutate(ctx context.Context, m interface{}, variables map[string]interface{}, options ...graphql.Option) error
	MutateRaw(ctx context.Context, m interface{}, variables map[string]interface{}, options ...graphql.Option) ([]byte, error)
	Exec(ctx context.Context, query string, m any, variables map[string]any, options ...graphql.Option) error
	ExecRaw(ctx context.Context, query string, variables map[string]any, options ...graphql.Option) ([]byte, error)
}

Client abstracts the interface provided by hasura/go-graphql-client so their implementation can be replaced by something else

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL