Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedPlanner ¶
type CachedPlanner struct { TTL time.Duration sync.RWMutex // contains filtered or unexported fields }
func NewCachedPlanner ¶
func NewCachedPlanner(ttl time.Duration) *CachedPlanner
func (*CachedPlanner) Plan ¶
func (cp *CachedPlanner) Plan(ctx *PlanningContext) (*QueryPlan, error)
func (*CachedPlanner) WithPlannerExecutor ¶ added in v0.1.8
func (cp *CachedPlanner) WithPlannerExecutor(e Planner) *CachedPlanner
type Planner ¶
type Planner interface {
Plan(*PlanningContext) (*QueryPlan, error)
}
type PlanningContext ¶
type PlanningContext struct { Operation *ast.OperationDefinition Request *requests.Request Schema *ast.Schema TypeURLMap merger.TypeURLMap }
PlanningContext contains the necessary information used to plan a query.
type QueryPlan ¶
type QueryPlan struct { RootSteps []*QueryPlanStep ScrubFields ScrubFields }
QueryPlan is a query execution plan
func (*QueryPlan) SetComputedValues ¶ added in v0.1.6
func (qp *QueryPlan) SetComputedValues(ctx *PlanningContext) *QueryPlan
type QueryPlanStep ¶
type QueryPlanStep struct { URL string OperationName *string ParentType string SelectionSet ast.SelectionSet InsertionPoint []string Then []*QueryPlanStep // artifacts QueryString string QueryStringHash [32]byte VariablesList []string // contains filtered or unexported fields }
Step is a single execution step
func (*QueryPlanStep) MarshalJSON ¶
func (s *QueryPlanStep) MarshalJSON() ([]byte, error)
MarshalJSON marshals the step the JSON. Used for test purposes only
func (*QueryPlanStep) SetComputedValues ¶ added in v0.1.6
func (s *QueryPlanStep) SetComputedValues(ctx *PlanningContext) *QueryPlanStep
SetComputedValues sets VariablesList and Query for QueryPlanStep. It triggers SetComputedValues on child steps
type ScrubFields ¶
func (ScrubFields) Clean ¶
func (sf ScrubFields) Clean(payload map[string]interface{})
func (ScrubFields) MarshalJSON ¶
func (sf ScrubFields) MarshalJSON() ([]byte, error)
func (ScrubFields) Merge ¶
func (sf ScrubFields) Merge(sfs ScrubFields)
func (ScrubFields) Set ¶
func (sf ScrubFields) Set(path []string, typename, fieldname string)
type SequentialPlanner ¶
type SequentialPlanner func(ctx *PlanningContext) (*QueryPlan, error)
func (SequentialPlanner) Plan ¶
func (sp SequentialPlanner) Plan(ctx *PlanningContext) (*QueryPlan, error)
Plan returns a query plan from the given planning context
Click to show internal directories.
Click to hide internal directories.