func (q *Query) List() []*Query {
	var list []*Query
	node := q
	for {
		if node == nil {
			break
		}
		if node.isRoot {
			node = node.Child()
			continue
		}
		list = append(list, node)
		node = node.Child()
	}
	return list
}
List converts a query to a list, excluding the root node
package querybuilder
import (
	"fmt"
	"sort"
	"strings"
)
type Query struct {
	Name         string
	Args         map[string]interface{}
	ConcreteType string
	child        *Query
	parent       *Query
	isRoot       bool
}
type queryArgs = map[string]interface{}
func NewRootQuery() *Query {
	return &Query{Name: "query", isRoot: true}
}
func NewQuery(name string, args map[string]interface{}) *Query {
	return &Query{Name: name, Args: args}
}
func (q *Query) AddChild(child *Query) {
	q.child = child
	child.parent = q
}
func (q *Query) Drop() *Query {
	p := q.parent
	q.parent.child = nil
	q.parent = nil
	return p
}
func (q Query) Child() *Query {
	return q.child
}
func (q Query) Parent() *Query {
	return q.parent
}
func (q *Query) Path() string {
	var p strings.Builder
	for {
		if q == nil {
			return p.String()
		}
		p.WriteString(fmt.Sprintf(".%s", q.Name))
		var queryArgs strings.Builder
		argsToString(q.Args, &queryArgs)
		p.WriteString(queryArgs.String())
		q = q.child
	}
}