graphql

package
v0.0.0-...-a423d60 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareGqlClient

func PrepareGqlClient(cfg *Config, httpCfg *httputil.Config, providers ...httpdirector.AuthorizationProvider) (*director.GraphQLClient, error)

func PrepareGqlClientWithHttpClient

func PrepareGqlClientWithHttpClient(cfg *Config, httpClient *http.Client) (*director.GraphQLClient, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config, gqlClient GraphQLClient) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *graphql.Request, res interface{}) error

type Config

type Config struct {
	GraphqlEndpoint string `mapstructure:"graphql_endpoint"`
	EnableLogging   bool   `mapstructure:"enable_logging"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

type GraphQLClient

type GraphQLClient interface {
	Run(ctx context.Context, req *graphql.Request, resp interface{}) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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