Versions in this module Expand all Collapse all v2 v2.0.1 Jan 7, 2024 Changes in this version + const VariableRendererKindCsv + const VariableRendererKindGraphqlResolve + const VariableRendererKindGraphqlWithValidation + const VariableRendererKindJson + const VariableRendererKindJsonWithValidation + const VariableRendererKindPlain + const VariableRendererKindPlanWithValidation + var ErrResolverClosed = errors.New("resolver closed") + var ErrUnableToResolve = errors.New("unable to resolve operation") + func GetDurationNanoSinceTraceStart(ctx context.Context) int64 + func SetInputUndefinedVariables(preparedInput *bytes.Buffer, undefinedVariables []string) error + func SetPlannerStats(ctx context.Context, stats PlannerStats) + func SetTraceStart(ctx context.Context, predictableDebugTimings bool) context.Context + func SingleFlightDisallowed(ctx context.Context) bool + type Array struct + Item Node + Items []Node + Nullable bool + Path []string + ResolveAsynchronous bool + func (_ *Array) NodeKind() NodeKind + func (a *Array) HasChildFetches() bool + func (a *Array) NodePath() []string + type BatchEntityFetch struct + DataSource DataSource + DataSourceIdentifier []byte + DisallowSingleFlight bool + Info *FetchInfo + Input BatchInput + PostProcessing PostProcessingConfiguration + Trace *DataSourceLoadTrace + func (_ *BatchEntityFetch) FetchKind() FetchKind + type BatchInput struct + Footer InputTemplate + Header InputTemplate + Items []InputTemplate + Separator InputTemplate + SkipEmptyObjectItems bool + SkipErrItems bool + SkipNullItems bool + type BigInt struct + Export *FieldExport + Nullable bool + Path []string + func (_ *BigInt) NodeKind() NodeKind + func (b *BigInt) NodePath() []string + type Boolean struct + Export *FieldExport + Nullable bool + Path []string + func (_ *Boolean) NodeKind() NodeKind + func (b *Boolean) NodePath() []string + type BufPair struct + Data *fastbuffer.FastBuffer + Errors *fastbuffer.FastBuffer + func NewBufPair() *BufPair + func (b *BufPair) HasData() bool + func (b *BufPair) HasErrors() bool + func (b *BufPair) Reset() + func (b *BufPair) WriteErr(message, locations, path, extensions []byte) + type CSVVariableRenderer struct + Kind string + func NewCSVVariableRenderer(arrayValueType JsonRootType) *CSVVariableRenderer + func NewCSVVariableRendererFromTypeRef(operation, definition *ast.Document, variableTypeRef int) *CSVVariableRenderer + func (c *CSVVariableRenderer) GetKind() string + func (c *CSVVariableRenderer) RenderVariable(_ context.Context, data []byte, out io.Writer) error + type ConnectDoneStats struct + Addr string + DurationSinceStartNano int64 + DurationSinceStartPretty string + Err string + Network string + type ConnectStartStats struct + Addr string + DurationSinceStartNano int64 + DurationSinceStartPretty string + Network string + type Context struct + Extensions []byte + InitialPayload []byte + RenameTypeNames []RenameTypeName + Request Request + RequestTracingOptions RequestTraceOptions + Stats Stats + Variables []byte + func NewContext(ctx context.Context) *Context + func (c *Context) Context() context.Context + func (c *Context) Free() + func (c *Context) SubgraphErrors() error + func (c *Context) WithContext(ctx context.Context) *Context + type ContextVariable struct + Path []string + Renderer VariableRenderer + func (_ *ContextVariable) GetVariableKind() VariableKind + func (c *ContextVariable) Equals(another Variable) bool + func (c *ContextVariable) TemplateSegment() TemplateSegment + type CustomNode struct + Nullable bool + Path []string + func (_ *CustomNode) NodeKind() NodeKind + func (c *CustomNode) NodePath() []string + type CustomResolve interface + Resolve func(value []byte) ([]byte, error) + type DNSDoneStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + type DNSStartStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + Host string + type DataSource interface + Load func(ctx context.Context, input []byte, w io.Writer) (err error) + type DataSourceLoadTrace struct + DurationLoadNano int64 + DurationLoadPretty string + DurationSinceStartNano int64 + DurationSinceStartPretty string + Input json.RawMessage + LoadError string + LoadSkipped bool + LoadStats *LoadStats + Output json.RawMessage + Path string + RawInputData json.RawMessage + SingleFlightSharedResponse bool + SingleFlightUsed bool + type DeferField struct + type EmptyArray struct + func (_ *EmptyArray) NodeKind() NodeKind + func (_ *EmptyArray) NodePath() []string + type EmptyObject struct + func (_ *EmptyObject) NodeKind() NodeKind + func (_ *EmptyObject) NodePath() []string + type EntityFetch struct + DataSource DataSource + DataSourceIdentifier []byte + DisallowSingleFlight bool + Info *FetchInfo + Input EntityInput + PostProcessing PostProcessingConfiguration + Trace *DataSourceLoadTrace + func (_ *EntityFetch) FetchKind() FetchKind + type EntityInput struct + Footer InputTemplate + Header InputTemplate + Item InputTemplate + SkipErrItem bool + type Fetch interface + FetchKind func() FetchKind + type FetchConfiguration struct + DataSource DataSource + DisallowSingleFlight bool + Input string + PostProcessing PostProcessingConfiguration + RequiresEntityBatchFetch bool + RequiresEntityFetch bool + RequiresParallelListItemFetch bool + RequiresSerialFetch bool + SetTemplateOutputToNullOnVariableNull bool + Variables Variables + type FetchInfo struct + DataSourceID string + type FetchKind int + const FetchKindEntity + const FetchKindEntityBatch + const FetchKindParallel + const FetchKindParallelListItem + const FetchKindSerial + const FetchKindSingle + type Fetches []Fetch + type Field struct + Defer *DeferField + IncludeDirectiveDefined bool + IncludeVariableName string + Info *FieldInfo + Name []byte + OnTypeNames [][]byte + Position Position + SkipDirectiveDefined bool + SkipVariableName string + Stream *StreamField + Value Node + type FieldExport struct + AsString bool + Path []string + type FieldInfo struct + Name string + NamedType string + ParentTypeNames []string + Source TypeFieldSource + func (i *FieldInfo) Merge(other *FieldInfo) + type Float struct + Export *FieldExport + Nullable bool + Path []string + func (_ *Float) NodeKind() NodeKind + func (f *Float) NodePath() []string + type GetConnStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + HostPort string + type GotConnStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + IdleTimeNano int64 + IdleTimePretty string + Reused bool + WasIdle bool + type GotFirstResponseByteStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + type GraphQLResponse struct + Data *Object + Info *GraphQLResponseInfo + RenameTypeNames []RenameTypeName + type GraphQLResponseInfo struct + OperationType ast.OperationType + type GraphQLSubscription struct + Response *GraphQLResponse + Trigger GraphQLSubscriptionTrigger + type GraphQLSubscriptionTrigger struct + Input []byte + InputTemplate InputTemplate + PostProcessing PostProcessingConfiguration + Source SubscriptionDataSource + Variables Variables + type GraphQLVariableRenderer struct + JSONSchema string + Kind string + func NewGraphQLVariableRenderer(jsonSchema string) *GraphQLVariableRenderer + func NewGraphQLVariableRendererFromJSONRootTypeWithoutValidation(rootType JsonRootType) (*GraphQLVariableRenderer, error) + func NewGraphQLVariableRendererFromTypeRef(operation, definition *ast.Document, variableTypeRef int) (*GraphQLVariableRenderer, error) + func NewGraphQLVariableRendererFromTypeRefWithOverrides(operation, definition *ast.Document, variableTypeRef int, ...) (*GraphQLVariableRenderer, error) + func NewGraphQLVariableRendererFromTypeRefWithoutValidation(operation, definition *ast.Document, variableTypeRef int) (*GraphQLVariableRenderer, error) + func (g *GraphQLVariableRenderer) GetKind() string + func (g *GraphQLVariableRenderer) RenderVariable(ctx context.Context, data []byte, out io.Writer) error + type GraphQLVariableResolveRenderer struct + Kind string + Node Node + func NewGraphQLVariableResolveRenderer(node Node) *GraphQLVariableResolveRenderer + func (g *GraphQLVariableResolveRenderer) GetKind() string + func (g *GraphQLVariableResolveRenderer) RenderVariable(ctx context.Context, data []byte, out io.Writer) error + type HeaderVariable struct + Path []string + func (h *HeaderVariable) Equals(another Variable) bool + func (h *HeaderVariable) GetVariableKind() VariableKind + func (h *HeaderVariable) TemplateSegment() TemplateSegment + type InputTemplate struct + Segments []TemplateSegment + SetTemplateOutputToNullOnVariableNull bool + func (i *InputTemplate) Render(ctx *Context, data []byte, preparedInput *bytes.Buffer) error + func (i *InputTemplate) RenderAndCollectUndefinedVariables(ctx *Context, data []byte, preparedInput *bytes.Buffer, ...) (err error) + type Integer struct + Export *FieldExport + Nullable bool + Path []string + func (_ *Integer) NodeKind() NodeKind + func (i *Integer) NodePath() []string + type JSONVariableRenderer struct + JSONSchema string + Kind string + func NewJSONVariableRenderer() *JSONVariableRenderer + func NewJSONVariableRendererWithValidation(jsonSchema string) *JSONVariableRenderer + func NewJSONVariableRendererWithValidationFromTypeRef(operation, definition *ast.Document, variableTypeRef int) (*JSONVariableRenderer, error) + func (r *JSONVariableRenderer) GetKind() string + func (r *JSONVariableRenderer) RenderVariable(ctx context.Context, data []byte, out io.Writer) error + type JsonRootType struct + Kind JsonRootTypeKind + Value jsonparser.ValueType + Values []jsonparser.ValueType + func (t JsonRootType) Satisfies(dataType jsonparser.ValueType) bool + type JsonRootTypeKind int + const JsonRootTypeKindMultiple + const JsonRootTypeKindSingle + type LoadStats struct + ConnectDone ConnectDoneStats + ConnectStart ConnectStartStats + DNSDone DNSDoneStats + DNSStart DNSStartStats + GetConn GetConnStats + GotConn GotConnStats + GotFirstResponseByte GotFirstResponseByteStats + TLSHandshakeDone TLSHandshakeDoneStats + TLSHandshakeStart TLSHandshakeStartStats + WroteHeaders WroteHeadersStats + WroteRequest WroteRequestStats + type Loader struct + func (l *Loader) Free() + func (l *Loader) LoadGraphQLResponseData(ctx *Context, response *GraphQLResponse, resolvable *Resolvable) (err error) + type Node interface + NodeKind func() NodeKind + NodePath func() []string + type NodeKind int + const NodeKindArray + const NodeKindBigInt + const NodeKindBoolean + const NodeKindCustom + const NodeKindEmptyArray + const NodeKindEmptyObject + const NodeKindFloat + const NodeKindInteger + const NodeKindNull + const NodeKindObject + const NodeKindScalar + const NodeKindString + type Null struct + func (_ *Null) NodeKind() NodeKind + func (_ *Null) NodePath() []string + type Object struct + Fetch Fetch + Fields []*Field + Nullable bool + Path []string + UnescapeResponseJson bool + func (_ *Object) NodeKind() NodeKind + func (o *Object) HasChildFetches() bool + func (o *Object) NodePath() []string + type ObjectVariable struct + Path []string + Renderer VariableRenderer + func (o *ObjectVariable) Equals(another Variable) bool + func (o *ObjectVariable) GetVariableKind() VariableKind + func (o *ObjectVariable) TemplateSegment() TemplateSegment + type ParallelFetch struct + Fetches []Fetch + Trace *DataSourceLoadTrace + func (_ *ParallelFetch) FetchKind() FetchKind + type ParallelListItemFetch struct + Fetch *SingleFetch + Trace *DataSourceLoadTrace + Traces []*SingleFetch + func (_ *ParallelListItemFetch) FetchKind() FetchKind + type PlainVariableRenderer struct + JSONSchema string + Kind string + func NewPlainVariableRenderer() *PlainVariableRenderer + func NewPlainVariableRendererWithValidation(jsonSchema string) *PlainVariableRenderer + func NewPlainVariableRendererWithValidationFromTypeRef(operation, definition *ast.Document, variableTypeRef int, ...) (*PlainVariableRenderer, error) + func (p *PlainVariableRenderer) GetKind() string + func (p *PlainVariableRenderer) RenderVariable(ctx context.Context, data []byte, out io.Writer) error + type PlannerStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + PlanningTimeNano int64 + PlanningTimePretty string + type Position struct + Column uint32 + Line uint32 + type PostProcessingConfiguration struct + MergePath []string + ResponseTemplate *InputTemplate + SelectResponseDataPath []string + SelectResponseErrorsPath []string + type RenameTypeName struct + From []byte + To []byte + type Reporter interface + SubscriptionUpdateSent func() + type Request struct + Header http.Header + ID string + type RequestTraceOptions struct + Enable bool + EnablePredictableDebugTimings bool + ExcludeInput bool + ExcludeLoadStats bool + ExcludeOutput bool + ExcludePlannerStats bool + ExcludeRawInputData bool + IncludeTraceOutputInResponseExtensions bool + func (r *RequestTraceOptions) DisableAll() + func (r *RequestTraceOptions) EnableAll() + type Resolvable struct + func NewResolvable() *Resolvable + func (r *Resolvable) Init(ctx *Context, initialData []byte, operationType ast.OperationType) (err error) + func (r *Resolvable) InitSubscription(ctx *Context, initialData []byte, postProcessing PostProcessingConfiguration) (err error) + func (r *Resolvable) Reset() + func (r *Resolvable) Resolve(ctx context.Context, root *Object, out io.Writer) error + type ResolvableObjectVariable struct + Renderer *GraphQLVariableResolveRenderer + func NewResolvableObjectVariable(node *Object) *ResolvableObjectVariable + func (h *ResolvableObjectVariable) Equals(another Variable) bool + func (h *ResolvableObjectVariable) GetVariableKind() VariableKind + func (h *ResolvableObjectVariable) TemplateSegment() TemplateSegment + type Resolver struct + func New(ctx context.Context, options ResolverOptions) *Resolver + func (r *Resolver) AsyncResolveGraphQLSubscription(ctx *Context, subscription *GraphQLSubscription, ...) (err error) + func (r *Resolver) AsyncUnsubscribeClient(connectionID int64) error + func (r *Resolver) AsyncUnsubscribeSubscription(id SubscriptionIdentifier) error + func (r *Resolver) ResolveGraphQLResponse(ctx *Context, response *GraphQLResponse, data []byte, writer io.Writer) (err error) + func (r *Resolver) ResolveGraphQLSubscription(ctx *Context, subscription *GraphQLSubscription, ...) error + type ResolverOptions struct + Debug bool + MaxConcurrency int + MaxSubscriptionWorkers int + Reporter Reporter + type ResponseWriter interface + type Scalar struct + Export *FieldExport + Nullable bool + Path []string + func (_ *Scalar) NodeKind() NodeKind + func (s *Scalar) NodePath() []string + type SegmentType int + const StaticSegmentType + const VariableSegmentType + type SerialFetch struct + Fetches []Fetch + Trace *DataSourceLoadTrace + func (_ *SerialFetch) FetchKind() FetchKind + type SimpleResolver struct + func NewSimpleResolver() *SimpleResolver + type SingleFetch struct + DataSourceIdentifier []byte + Info *FetchInfo + InputTemplate InputTemplate + SerialID int + Trace *DataSourceLoadTrace + func (_ *SingleFetch) FetchKind() FetchKind + type SingleFlightStats struct + SingleFlightSharedResponse bool + SingleFlightUsed bool + func GetSingleFlightStats(ctx context.Context) *SingleFlightStats + type Stats struct + CombinedResponseSize atomic.Int64 + NumberOfFetches atomic.Int32 + ResolvedLeafs int + ResolvedNodes int + ResolvedObjects int + func (s *Stats) Reset() + type StreamField struct + InitialBatchSize int + type String struct + Export *FieldExport + IsTypeName bool + Nullable bool + Path []string + UnescapeResponseJson bool + func (_ *String) NodeKind() NodeKind + func (s *String) NodePath() []string + type SubscriptionDataSource interface + Start func(ctx *Context, input []byte, updater SubscriptionUpdater) error + UniqueRequestID func(ctx *Context, input []byte, xxh *xxhash.Digest) (err error) + type SubscriptionIdentifier struct + ConnectionID int64 + SubscriptionID int64 + type SubscriptionResponseWriter interface + Complete func() + Flush func() + type SubscriptionUpdater interface + Done func() + Update func(data []byte) + type TLSHandshakeDoneStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + Err string + type TLSHandshakeStartStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + type TemplateSegment struct + Data []byte + Renderer VariableRenderer + SegmentType SegmentType + Segments []TemplateSegment + VariableKind VariableKind + VariableSourcePath []string + type TraceFetch struct + DataSourceID string + DataSourceLoadTrace *DataSourceLoadTrace + DataSourceLoadTraces []*DataSourceLoadTrace + Fetches []*TraceFetch + Id string + Path string + Type TraceFetchType + type TraceFetchEvents struct + InputBeforeSourceLoad json.RawMessage + type TraceFetchType string + const TraceFetchTypeBatchEntity + const TraceFetchTypeEntity + const TraceFetchTypeParallel + const TraceFetchTypeParallelListItem + const TraceFetchTypeSerial + const TraceFetchTypeSingle + type TraceField struct + DataSourceIDs []string + Name string + NamedType string + ParentTypeNames []string + Value *TraceNode + type TraceInfo struct + PlannerStats PlannerStats + TraceStart time.Time + TraceStartTime string + TraceStartUnix int64 + func GetTraceInfo(ctx context.Context) *TraceInfo + type TraceNode struct + Fetch *TraceFetch + Fields []*TraceField + Info *TraceInfo + IsTypeName bool + Items []*TraceNode + NodeType TraceNodeType + Nullable bool + Path []string + UnescapeResponseJson bool + func GetTrace(ctx context.Context, root *Object) *TraceNode + type TraceNodeType string + const TraceNodeTypeArray + const TraceNodeTypeBigInt + const TraceNodeTypeBoolean + const TraceNodeTypeCustom + const TraceNodeTypeEmptyArray + const TraceNodeTypeEmptyObject + const TraceNodeTypeFloat + const TraceNodeTypeInteger + const TraceNodeTypeNull + const TraceNodeTypeObject + const TraceNodeTypeScalar + const TraceNodeTypeString + const TraceNodeTypeUnknown + type TypeFieldSource struct + IDs []string + type Variable interface + Equals func(another Variable) bool + GetVariableKind func() VariableKind + TemplateSegment func() TemplateSegment + type VariableKind int + const ContextVariableKind + const HeaderVariableKind + const ListVariableKind + const ObjectVariableKind + const ResolvableObjectVariableKind + type VariableRenderer interface + GetKind func() string + RenderVariable func(ctx context.Context, data []byte, out io.Writer) error + type Variables []Variable + func NewVariables(variables ...Variable) Variables + func (v *Variables) AddVariable(variable Variable) (name string, exists bool) + type WroteHeadersStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + type WroteRequestStats struct + DurationSinceStartNano int64 + DurationSinceStartPretty string + Err string