actograph

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 12 Imported by: 0

README

ActoGraphql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actograph added in v0.0.2

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

func NewActograph added in v0.0.2

func NewActograph() *Actograph

func NewActographBytes added in v0.0.2

func NewActographBytes(graphqlFile []byte) (*Actograph, error)

func NewActographFiles added in v0.0.3

func NewActographFiles(filenames ...string) (*Actograph, error)

func (*Actograph) ConstructDirective added in v0.0.2

func (agh *Actograph) ConstructDirective(dir *ast.Directive, node ast.Node) (directive.Directive, error)

func (*Actograph) Do added in v0.0.2

func (agh *Actograph) Do(request RequestQuery) (*Result, error)

func (*Actograph) Parse added in v0.0.2

func (agh *Actograph) Parse(graphqlFile []byte) error

func (*Actograph) RegisterDirective added in v0.0.2

func (agh *Actograph) RegisterDirective(dir directive.Definition) error

func (*Actograph) RegisterDirectives added in v0.0.2

func (agh *Actograph) RegisterDirectives(dirs ...directive.Definition) error

func (*Actograph) RegisterScalar added in v0.0.4

func (agh *Actograph) RegisterScalar(cfg ScalarConfig) error

func (*Actograph) RegisterScalars added in v0.0.4

func (agh *Actograph) RegisterScalars(cfgs ...ScalarConfig) error

func (*Actograph) Schema added in v0.0.2

func (agh *Actograph) Schema() (graphql.Schema, error)

func (*Actograph) Validate added in v0.0.2

func (agh *Actograph) Validate() error

type ParseLiteralFn added in v0.0.4

type ParseLiteralFn func(valueAST ast.Value) interface{}

ParseLiteralFn is a function type for parsing the literal value of a GraphQLScalar type

type ParseValueFn added in v0.0.4

type ParseValueFn func(value interface{}) interface{}

ParseValueFn is a function type for parsing the value of a GraphQLScalar type

type RequestQuery

type RequestQuery struct {
	// A GraphQL language formatted string representing the requested operation.
	RequestString string

	// A mapping of variable name to runtime value to use for all variables
	// defined in the requestString.
	VariableValues map[string]interface{}

	// The name of the operation to use if requestString contains multiple
	// possible operations. Can be omitted if requestString contains only
	// one operation.
	OperationName string

	// The value provided as the first argument to resolver functions on the top
	// level type (e.g. the query object type).
	RootObject map[string]interface{}

	// Context may be provided to pass application-specific per-request
	// information to resolve functions.
	Context context.Context
}

type Result

type Result struct {
	Data       interface{}                `json:"data"`
	Errors     []gqlerrors.FormattedError `json:"errors,omitempty"`
	Extensions map[string]interface{}     `json:"extensions,omitempty"`
}

Result has the response, errors and extensions from the resolved schema

type ScalarConfig added in v0.0.4

type ScalarConfig struct {
	Name         string
	Description  string
	Serialize    SerializeFn
	ParseValue   ParseValueFn
	ParseLiteral ParseLiteralFn
}

ScalarConfig options for creating a new GraphQLScalar

type ScalarDefinition added in v0.0.4

type ScalarDefinition struct {
	Name        string
	Description string
}

type SerializeFn added in v0.0.4

type SerializeFn func(value interface{}) interface{}

SerializeFn is a function type for serializing a GraphQLScalar type value

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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