func (q *QueryTree) Schema() *schema.Schema {
	return q.schema
}
Schema returns the underlying schema.
package client
import (
	"sync"
	"github.com/rgraphql/magellan/schema"
	"github.com/rgraphql/magellan/varstore"
	"github.com/graphql-go/graphql/language/ast"
	"github.com/graphql-go/graphql/language/visitor"
	"github.com/pkg/errors"
	proto "github.com/rgraphql/rgraphql"
)
type QueryTree struct {
	schema *schema.Schema
	root *qtNode
	mtx sync.Mutex
	varStore *varstore.VariableStore
	attachedQueries map[*Query]*qtAttachedQuery
	handler QueryTreeHandler
	nextID uint32
	pendingVariables []*proto.ASTVariable
}
type QueryTreeHandler interface {
	HandleMutation(mut *proto.RGQLQueryTreeMutation)
}
func NewQueryTree(schema *schema.Schema, handler QueryTreeHandler) (*QueryTree, error) {
	if schema == nil || schema.Definitions == nil || schema.Definitions.RootQuery == nil {
		return nil, errors.New("definitions and root query must not be nil")
	}
	rootQuery := schema.Definitions.RootQuery
	qt := &QueryTree{
		schema:  schema,
		handler: handler,
		nextID:  1,
		attachedQueries: make(map[*Query]*qtAttachedQuery),
	}
	qt.varStore = varstore.NewVariableStore(newQtVarStoreHandler(qt))
	qt.root = newQtNode(rootQuery, qt.varStore)
	return qt, nil
}