func (v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic) GetTypename() string {
	return v.Typename
}
GetTypename returns InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic.Typename, and is useful for accessing the field via an interface.
package test
import (
	"encoding/json"
	"fmt"
	"github.com/Khan/genqlient/graphql"
	"github.com/Khan/genqlient/internal/testutil"
)
type InterfaceNestingResponse struct {
	Root InterfaceNestingRootTopic `json:"root"`
}
func (v *InterfaceNestingResponse) GetRoot() InterfaceNestingRootTopic { return v.Root }
type InterfaceNestingRootTopic struct {
	Id       testutil.ID                                `json:"id"`
	Children []InterfaceNestingRootTopicChildrenContent `json:"-"`
}
func (v *InterfaceNestingRootTopic) GetId() testutil.ID { return v.Id }
func (v *InterfaceNestingRootTopic) GetChildren() []InterfaceNestingRootTopicChildrenContent {
	return v.Children
}
func (v *InterfaceNestingRootTopic) UnmarshalJSON(b []byte) error {
	if string(b) == "null" {
		return nil
	}
	var firstPass struct {
		*InterfaceNestingRootTopic
		Children []json.RawMessage `json:"children"`
		graphql.NoUnmarshalJSON
	}
	firstPass.InterfaceNestingRootTopic = v
	err := json.Unmarshal(b, &firstPass)
	if err != nil {
		return err
	}
	{
		dst := &v.Children
		src := firstPass.Children
		*dst = make(
			[]InterfaceNestingRootTopicChildrenContent,
			len(src))
		for i, src := range src {
			dst := &(*dst)[i]
			if len(src) != 0 && string(src) != "null" {
				err = __unmarshalInterfaceNestingRootTopicChildrenContent(
					src, dst)
				if err != nil {
					return fmt.Errorf(
						"Unable to unmarshal InterfaceNestingRootTopic.Children: %w", err)
				}
			}
		}
	}
	return nil
}
type __premarshalInterfaceNestingRootTopic struct {
	Id testutil.ID `json:"id"`
	Children []json.RawMessage `json:"children"`
}
func (v *InterfaceNestingRootTopic) MarshalJSON() ([]byte, error) {
	premarshaled, err := v.__premarshalJSON()
	if err != nil {
		return nil, err
	}
	return json.Marshal(premarshaled)
}
func (v *InterfaceNestingRootTopic) __premarshalJSON() (*__premarshalInterfaceNestingRootTopic, error) {
	var retval __premarshalInterfaceNestingRootTopic
	retval.Id = v.Id
	{
		dst := &retval.Children
		src := v.Children
		*dst = make(
			[]json.RawMessage,
			len(src))
		for i, src := range src {
			dst := &(*dst)[i]
			var err error
			*dst, err = __marshalInterfaceNestingRootTopicChildrenContent(
				&src)
			if err != nil {
				return nil, fmt.Errorf(
					"Unable to marshal InterfaceNestingRootTopic.Children: %w", err)
			}
		}
	}
	return &retval, nil
}
type InterfaceNestingRootTopicChildrenArticle struct {
	Typename string `json:"__typename"`
	Id     testutil.ID                                         `json:"id"`
	Parent InterfaceNestingRootTopicChildrenContentParentTopic `json:"parent"`
}
func (v *InterfaceNestingRootTopicChildrenArticle) GetTypename() string { return v.Typename }
func (v *InterfaceNestingRootTopicChildrenArticle) GetId() testutil.ID { return v.Id }
func (v *InterfaceNestingRootTopicChildrenArticle) GetParent() InterfaceNestingRootTopicChildrenContentParentTopic {
	return v.Parent
}
type InterfaceNestingRootTopicChildrenContent interface {
	implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContent()
	GetTypename() string
	GetId() testutil.ID
	GetParent() InterfaceNestingRootTopicChildrenContentParentTopic
}
func (v *InterfaceNestingRootTopicChildrenArticle) implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContent() {
}
func (v *InterfaceNestingRootTopicChildrenVideo) implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContent() {
}
func (v *InterfaceNestingRootTopicChildrenTopic) implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContent() {
}
func __unmarshalInterfaceNestingRootTopicChildrenContent(b []byte, v *InterfaceNestingRootTopicChildrenContent) error {
	if string(b) == "null" {
		return nil
	}
	var tn struct {
		TypeName string `json:"__typename"`
	}
	err := json.Unmarshal(b, &tn)
	if err != nil {
		return err
	}
	switch tn.TypeName {
	case "Article":
		*v = new(InterfaceNestingRootTopicChildrenArticle)
		return json.Unmarshal(b, *v)
	case "Video":
		*v = new(InterfaceNestingRootTopicChildrenVideo)
		return json.Unmarshal(b, *v)
	case "Topic":
		*v = new(InterfaceNestingRootTopicChildrenTopic)
		return json.Unmarshal(b, *v)
	case "":
		return fmt.Errorf(
			"Response was missing Content.__typename")
	default:
		return fmt.Errorf(
			`Unexpected concrete type for InterfaceNestingRootTopicChildrenContent: "%v"`, tn.TypeName)
	}
}
func __marshalInterfaceNestingRootTopicChildrenContent(v *InterfaceNestingRootTopicChildrenContent) ([]byte, error) {
	var typename string
	switch v := (*v).(type) {
	case *InterfaceNestingRootTopicChildrenArticle:
		typename = "Article"
		result := struct {
			TypeName string `json:"__typename"`
			*InterfaceNestingRootTopicChildrenArticle
		}{typename, v}
		return json.Marshal(result)
	case *InterfaceNestingRootTopicChildrenVideo:
		typename = "Video"
		result := struct {
			TypeName string `json:"__typename"`
			*InterfaceNestingRootTopicChildrenVideo
		}{typename, v}
		return json.Marshal(result)
	case *InterfaceNestingRootTopicChildrenTopic:
		typename = "Topic"
		result := struct {
			TypeName string `json:"__typename"`
			*InterfaceNestingRootTopicChildrenTopic
		}{typename, v}
		return json.Marshal(result)
	case nil:
		return []byte("null"), nil
	default:
		return nil, fmt.Errorf(
			`Unexpected concrete type for InterfaceNestingRootTopicChildrenContent: "%T"`, v)
	}
}
type InterfaceNestingRootTopicChildrenContentParentTopic struct {
	Id       testutil.ID                                                          `json:"id"`
	Children []InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent `json:"-"`
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopic) GetId() testutil.ID { return v.Id }
func (v *InterfaceNestingRootTopicChildrenContentParentTopic) GetChildren() []InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent {
	return v.Children
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopic) UnmarshalJSON(b []byte) error {
	if string(b) == "null" {
		return nil
	}
	var firstPass struct {
		*InterfaceNestingRootTopicChildrenContentParentTopic
		Children []json.RawMessage `json:"children"`
		graphql.NoUnmarshalJSON
	}
	firstPass.InterfaceNestingRootTopicChildrenContentParentTopic = v
	err := json.Unmarshal(b, &firstPass)
	if err != nil {
		return err
	}
	{
		dst := &v.Children
		src := firstPass.Children
		*dst = make(
			[]InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent,
			len(src))
		for i, src := range src {
			dst := &(*dst)[i]
			if len(src) != 0 && string(src) != "null" {
				err = __unmarshalInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent(
					src, dst)
				if err != nil {
					return fmt.Errorf(
						"Unable to unmarshal InterfaceNestingRootTopicChildrenContentParentTopic.Children: %w", err)
				}
			}
		}
	}
	return nil
}
type __premarshalInterfaceNestingRootTopicChildrenContentParentTopic struct {
	Id testutil.ID `json:"id"`
	Children []json.RawMessage `json:"children"`
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopic) MarshalJSON() ([]byte, error) {
	premarshaled, err := v.__premarshalJSON()
	if err != nil {
		return nil, err
	}
	return json.Marshal(premarshaled)
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopic) __premarshalJSON() (*__premarshalInterfaceNestingRootTopicChildrenContentParentTopic, error) {
	var retval __premarshalInterfaceNestingRootTopicChildrenContentParentTopic
	retval.Id = v.Id
	{
		dst := &retval.Children
		src := v.Children
		*dst = make(
			[]json.RawMessage,
			len(src))
		for i, src := range src {
			dst := &(*dst)[i]
			var err error
			*dst, err = __marshalInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent(
				&src)
			if err != nil {
				return nil, fmt.Errorf(
					"Unable to marshal InterfaceNestingRootTopicChildrenContentParentTopic.Children: %w", err)
			}
		}
	}
	return &retval, nil
}
type InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle struct {
	Typename string `json:"__typename"`
	Id testutil.ID `json:"id"`
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle) GetTypename() string {
	return v.Typename
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle) GetId() testutil.ID {
	return v.Id
}
type InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent interface {
	implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent()
	GetTypename() string
	GetId() testutil.ID
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle) implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent() {
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenVideo) implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent() {
}
func (v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic) implementsGraphQLInterfaceInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent() {
}
func __unmarshalInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent(b []byte, v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent) error {
	if string(b) == "null" {
		return nil
	}
	var tn struct {
		TypeName string `json:"__typename"`
	}
	err := json.Unmarshal(b, &tn)
	if err != nil {
		return err
	}
	switch tn.TypeName {
	case "Article":
		*v = new(InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle)
		return json.Unmarshal(b, *v)
	case "Video":
		*v = new(InterfaceNestingRootTopicChildrenContentParentTopicChildrenVideo)
		return json.Unmarshal(b, *v)
	case "Topic":
		*v = new(InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic)
		return json.Unmarshal(b, *v)
	case "":
		return fmt.Errorf(
			"Response was missing Content.__typename")
	default:
		return fmt.Errorf(
			`Unexpected concrete type for InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent: "%v"`, tn.TypeName)
	}
}
func __marshalInterfaceNestingRootTopicChildrenContentParentTopicChildrenContent(v *InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent) ([]byte, error) {
	var typename string
	switch v := (*v).(type) {
	case *InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle:
		typename = "Article"
		result := struct {
			TypeName string `json:"__typename"`
			*InterfaceNestingRootTopicChildrenContentParentTopicChildrenArticle
		}{typename, v}
		return json.Marshal(result)
	case *InterfaceNestingRootTopicChildrenContentParentTopicChildrenVideo:
		typename = "Video"
		result := struct {
			TypeName string `json:"__typename"`
			*InterfaceNestingRootTopicChildrenContentParentTopicChildrenVideo
		}{typename, v}
		return json.Marshal(result)
	case *InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic:
		typename = "Topic"
		result := struct {
			TypeName string `json:"__typename"`
			*InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic
		}{typename, v}
		return json.Marshal(result)
	case nil:
		return []byte("null"), nil
	default:
		return nil, fmt.Errorf(
			`Unexpected concrete type for InterfaceNestingRootTopicChildrenContentParentTopicChildrenContent: "%T"`, v)
	}
}
type InterfaceNestingRootTopicChildrenContentParentTopicChildrenTopic struct {
	Typename string `json:"__typename"`
	Id testutil.ID `json:"id"`
}