graphql

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationMutation OperationType = "mutation"
	OperationQuery    OperationType = "query"

	MethodPost OperationMethod = http.MethodPost
	MethodGet  OperationMethod = http.MethodGet
)
View Source
const Namespace = "github.com/starvn/turbo/transport/http/client/graphql"

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

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

func New

func New(opt Options) Extractor

func (Extractor) BodyFromBody

func (e Extractor) BodyFromBody(r io.Reader) ([]byte, error)

func (Extractor) BodyFromParams

func (e Extractor) BodyFromParams(params map[string]string) ([]byte, error)

func (Extractor) QueryFromBody

func (e Extractor) QueryFromBody(r io.Reader) (url.Values, error)

func (Extractor) QueryFromParams

func (e Extractor) QueryFromParams(params map[string]string) (url.Values, error)

type GraphQLRequest

type GraphQLRequest struct {
	Query         string                 `json:"query"`
	OperationName string                 `json:"operationName,omitempty"`
	Variables     map[string]interface{} `json:"variables,omitempty"`
}

type OperationMethod

type OperationMethod string

type OperationType

type OperationType string

type Options

type Options struct {
	GraphQLRequest
	QueryPath string          `json:"query_path,omitempty"`
	Type      OperationType   `json:"type"`
	Method    OperationMethod `json:"method"`
}

func GetOptions

func GetOptions(cfg config.ExtraConfig) (*Options, error)

Jump to

Keyboard shortcuts

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