operation

package
v0.176.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestWithMetadata added in v0.166.0

func RequestWithMetadata(r *http.Request, metadata *Metadata) *http.Request

RequestWithMetadata returns a new *http.Request carrying the given Metadata in its Context().

func WithMetadata added in v0.166.0

func WithMetadata(ctx context.Context, metadata *Metadata) context.Context

WithMetadata returns a new context.Context which stores the given Metadata.

Types

type Metadata added in v0.166.0

type Metadata struct {
	OperationName string
	OperationType Type
}

func MetadataFromContext added in v0.166.0

func MetadataFromContext(ctx context.Context) *Metadata

MetadataFromContext returns the operation metadata associated with the given context. If there's no metadata, it returns nil.

func NewMetadata added in v0.166.0

func NewMetadata(op *wgpb.Operation) *Metadata

type Type added in v0.166.0

type Type int
const (
	TypeInvalid Type = iota
	TypeQuery
	TypeMutation
	TypeSubscription
)

func TypeFromASTOperationType added in v0.166.0

func TypeFromASTOperationType(typ ast.OperationType) Type

func TypeFromOperationType added in v0.166.0

func TypeFromOperationType(typ wgpb.OperationType) Type

func (Type) String added in v0.166.0

func (t Type) String() string

Jump to

Keyboard shortcuts

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