func nextPrefix(prefix *prefixList, field *ast.Field) *prefixList {
	prefix = typeNameParts(prefix, field.ObjectDefinition.Name)
	prefix = &prefixList{upperFirst(field.Alias), prefix}
	return prefix
}
Given a prefix-list, and a field, compute the next prefix-list, which will
be used for that field's selections.
package generate
import (
	"strings"
	"github.com/vektah/gqlparser/v2/ast"
)
type prefixList struct {
	head string  
	tail *prefixList
}
func newPrefixList(item string) *prefixList {
	return &prefixList{head: item}
}
func joinPrefixList(prefix *prefixList) string {
	var reversed []string
	for ; prefix != nil; prefix = prefix.tail {
		reversed = append(reversed, prefix.head)
	}
	l := len(reversed)
	for i := 0; i < l/2; i++ {
		reversed[i], reversed[l-1-i] = reversed[l-1-i], reversed[i]
	}
	return strings.Join(reversed, "")
}
func typeNameParts(prefix *prefixList, typeName string) *prefixList {
	typeName = upperFirst(typeName)
	if prefix == nil || prefix.tail == nil ||
		strings.HasSuffix(joinPrefixList(prefix), typeName) {
		return prefix
	}
	return &prefixList{typeName, prefix}
}