func (r *TypeResolver) Name() (typeName *string) {
	if r.NameCache != "" {
		return &r.NameCache
	}
	name := resolveNamedType(r.AST)
	if name != nil {
		r.NameCache = *name
	}
	return name
}
Name resolves the name of the Type.
package introspect
import (
	"reflect"
	"strings"
	"github.com/graphql-go/graphql/language/ast"
)
type ASTLookup interface {
	LookupType(ast.Type) ast.TypeDefinition
}
type ObjectResolver struct {
	Lookup         ASTLookup
	AST            *ast.ObjectDefinition
	SchemaResolver *SchemaResolver
}
func (sr *ObjectResolver) Schema() *SchemaResolver {
	return sr.SchemaResolver
}
func (sr *ObjectResolver) Type() *TypeResolver {
	return &TypeResolver{
		Lookup: sr.Lookup,
		AST:    sr.AST,
	}
}
type SchemaResolver struct {
	Lookup    ASTLookup
	RootQuery ast.TypeDefinition
	NamedTypes map[string]ast.TypeDefinition
}
func (r *SchemaResolver) QueryType() *TypeResolver {
	if r.RootQuery == nil {
		return nil
	}
	return &TypeResolver{
		Lookup: r.Lookup,
		AST:    r.RootQuery,
	}
}
func (r *SchemaResolver) Directives() []*DirectiveResolver {
	return []*DirectiveResolver{}
}
func (r *SchemaResolver) Types() []*TypeResolver {
	res := make([]*TypeResolver, len(r.NamedTypes))
	i := 0
	for _, typ := range r.NamedTypes {
		res[i] = &TypeResolver{
			AST:    typ,
			Lookup: r.Lookup,
		}
		i++
	}
	return res
}
type TypeResolver struct {
	Lookup ASTLookup
	NameCache string
	AST       ast.Node
}
func (r *TypeResolver) Kind() string {
	kindSrc := r.AST.GetKind()
	kindSrc = strings.TrimSuffix(kindSrc, "Definition")
	kindSrc = strings.ToUpper(kindSrc)
	return kindSrc
}
type namedType interface {
	GetName() *ast.Name
}
func resolveNamedType(typ ast.Node) (typeName *string) {
	named, ok := typ.(namedType)
	if !ok {
		return
	}
	name := named.GetName()
	if name == nil || name.Value == "" {
		return
	}
	return &name.Value
}