Versions in this module Expand all Collapse all v1 v1.41.0 Jun 27, 2022 Changes in this version + const FetchKindBatch + const FetchKindParallel + const FetchKindSingle + const NodeKindArray + const NodeKindBoolean + const NodeKindEmptyArray + const NodeKindEmptyObject + const NodeKindFloat + const NodeKindInteger + const NodeKindNull + const NodeKindObject + const NodeKindString + const VariableRendererKindCsv + const VariableRendererKindGraphqlWithValidation + const VariableRendererKindJson + const VariableRendererKindJsonWithValidation + const VariableRendererKindPlain + const VariableRendererKindPlanWithValidation + var ErrUnableToResolve = errors.New("unable to resolve operation") + type AfterFetchHook interface + OnData func(ctx HookContext, output []byte, singleFlight bool) + OnError func(ctx HookContext, output []byte, singleFlight bool) + type Array struct + Item Node + Nullable bool + Path []string + ResolveAsynchronous bool + Stream Stream + UnescapeResponseJson bool + func (_ *Array) NodeKind() NodeKind + type BatchFetch struct + BatchFactory DataSourceBatchFactory + Fetch *SingleFetch + func (_ *BatchFetch) FetchKind() FetchKind + type BeforeFetchHook interface + OnBeforeFetch func(ctx HookContext, input []byte) + type Boolean struct + Export *FieldExport + Nullable bool + Path []string + func (_ *Boolean) NodeKind() NodeKind + 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 Context struct + RenameTypeNames []RenameTypeName + Request Request + Variables []byte + func NewContext(ctx context.Context) *Context + func (c *Context) Clone() Context + func (c *Context) Free() + func (c *Context) SetAfterFetchHook(hook AfterFetchHook) + func (c *Context) SetBeforeFetchHook(hook BeforeFetchHook) + type ContextVariable struct + Path []string + Renderer VariableRenderer + func (_ *ContextVariable) GetVariableKind() VariableKind + func (c *ContextVariable) Equals(another Variable) bool + func (c *ContextVariable) TemplateSegment() TemplateSegment + type DataSource interface + Load func(ctx context.Context, input []byte, w io.Writer) (err error) + type DataSourceBatch interface + Demultiplex func(responseBufPair *BufPair, bufPairs []*BufPair) (err error) + Input func() *fastbuffer.FastBuffer + type DataSourceBatchFactory interface + CreateBatch func(inputs [][]byte) (DataSourceBatch, error) + type Defer struct + Enabled bool + PatchIndex int + type DeferField struct + type EmptyArray struct + func (_ *EmptyArray) NodeKind() NodeKind + type EmptyObject struct + func (_ *EmptyObject) NodeKind() NodeKind + type Fetch interface + FetchKind func() FetchKind + type FetchKind int + type Fetcher struct + EnableSingleFlightLoader bool + func NewFetcher(enableSingleFlightLoader bool) *Fetcher + func (f *Fetcher) Fetch(ctx *Context, fetch *SingleFetch, preparedInput *fastbuffer.FastBuffer, ...) (err error) + func (f *Fetcher) FetchBatch(ctx *Context, fetch *BatchFetch, preparedInputs []*fastbuffer.FastBuffer, ...) (err error) + type Fetches []Fetch + type Field struct + BufferID int + Defer *DeferField + HasBuffer bool + IncludeDirectiveDefined bool + IncludeVariableName string + Name []byte + OnTypeName []byte + Position Position + SkipDirectiveDefined bool + SkipVariableName string + Stream *StreamField + Value Node + type FieldExport struct + AsString bool + Path []string + type Float struct + Export *FieldExport + Nullable bool + Path []string + func (_ *Float) NodeKind() NodeKind + type FlushWriter interface + Flush func() + type GraphQLResponse struct + Data Node + RenameTypeNames []RenameTypeName + type GraphQLResponsePatch struct + Fetch Fetch + Operation []byte + Value Node + type GraphQLStreamingResponse struct + FlushInterval int64 + InitialResponse *GraphQLResponse + Patches []*GraphQLResponsePatch + type GraphQLSubscription struct + Response *GraphQLResponse + Trigger GraphQLSubscriptionTrigger + type GraphQLSubscriptionTrigger struct + Input []byte + InputTemplate InputTemplate + Source SubscriptionDataSource + Variables Variables + type GraphQLVariableRenderer struct + JSONSchema string + Kind string + func NewGraphQLVariableRenderer(jsonSchema string) *GraphQLVariableRenderer + 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 HeaderVariable struct + Path []string + func (h *HeaderVariable) Equals(another Variable) bool + func (h *HeaderVariable) GetVariableKind() VariableKind + func (h *HeaderVariable) TemplateSegment() TemplateSegment + type HookContext struct + CurrentPath []byte + type InputTemplate struct + Segments []TemplateSegment + func (i *InputTemplate) Render(ctx *Context, data []byte, preparedInput *fastbuffer.FastBuffer) (err error) + type Integer struct + Export *FieldExport + Nullable bool + Path []string + func (_ *Integer) NodeKind() NodeKind + 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 Node interface + NodeKind func() NodeKind + type NodeKind int + type Null struct + Defer Defer + func (_ *Null) NodeKind() NodeKind + type Object struct + Fetch Fetch + Fields []*Field + Nullable bool + Path []string + UnescapeResponseJson bool + func (_ *Object) NodeKind() NodeKind + 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 + func (_ *ParallelFetch) 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 Position struct + Column uint32 + Line uint32 + type ProcessResponseConfig struct + ExtractFederationEntities bool + ExtractGraphqlResponse bool + type RenameTypeName struct + From []byte + To []byte + type Request struct + Header http.Header + type Resolver struct + func New(ctx context.Context, fetcher *Fetcher, enableDataLoader bool) *Resolver + func (r *Resolver) MergeBufPairData(from, to *BufPair, prefixDataWithComma bool) + func (r *Resolver) MergeBufPairErrors(from, to *BufPair) + func (r *Resolver) MergeBufPairs(from, to *BufPair, prefixDataWithComma bool) + func (r *Resolver) ResolveGraphQLResponse(ctx *Context, response *GraphQLResponse, data []byte, writer io.Writer) (err error) + func (r *Resolver) ResolveGraphQLResponsePatch(ctx *Context, patch *GraphQLResponsePatch, data, path, extraPath []byte, ...) (err error) + func (r *Resolver) ResolveGraphQLStreamingResponse(ctx *Context, response *GraphQLStreamingResponse, data []byte, ...) (err error) + func (r *Resolver) ResolveGraphQLSubscription(ctx *Context, subscription *GraphQLSubscription, writer FlushWriter) (err error) + type SegmentType int + const StaticSegmentType + const VariableSegmentType + type SingleFetch struct + BufferId int + DataSource DataSource + DataSourceIdentifier []byte + DisableDataLoader bool + DisallowSingleFlight bool + Input string + InputTemplate InputTemplate + ProcessResponseConfig ProcessResponseConfig + Variables Variables + func (_ *SingleFetch) FetchKind() FetchKind + type Stream struct + Enabled bool + InitialBatchSize int + PatchIndex int + type StreamField struct + InitialBatchSize int + type String struct + Export *FieldExport + IsTypeName bool + Nullable bool + Path []string + UnescapeResponseJson bool + func (_ *String) NodeKind() NodeKind + type SubscriptionDataSource interface + Start func(ctx context.Context, input []byte, next chan<- []byte) error + type TemplateSegment struct + Data []byte + Renderer VariableRenderer + SegmentType SegmentType + VariableKind VariableKind + VariableSourcePath []string + type Variable interface + Equals func(another Variable) bool + GetVariableKind func() VariableKind + TemplateSegment func() TemplateSegment + type VariableKind int + const ContextVariableKind + const HeaderVariableKind + const ObjectVariableKind + type VariableRenderer interface + GetKind func() string + RenderVariable func(ctx context.Context, data []byte, out io.Writer) error + type VariableSchema struct + type Variables []Variable + func NewVariables(variables ...Variable) Variables + func (v *Variables) AddVariable(variable Variable) (name string, exists bool)