func (wnfc *WithNilFieldsCreate) SaveX(ctx context.Context) *WithNilFields {
	v, err := wnfc.Save(ctx)
	if err != nil {
		panic(err)
	}
	return v
}
SaveX calls Save and panics if Save returns an error.
package ent
import (
	"context"
	"fmt"
	"entgo.io/contrib/schemast/internal/mutatetest/ent/withnilfields"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"entgo.io/ent/schema/field"
)
type WithNilFieldsCreate struct {
	config
	mutation *WithNilFieldsMutation
	hooks    []Hook
}
func (wnfc *WithNilFieldsCreate) Mutation() *WithNilFieldsMutation {
	return wnfc.mutation
}
func (wnfc *WithNilFieldsCreate) Save(ctx context.Context) (*WithNilFields, error) {
	var (
		err  error
		node *WithNilFields
	)
	if len(wnfc.hooks) == 0 {
		if err = wnfc.check(); err != nil {
			return nil, err
		}
		node, err = wnfc.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*WithNilFieldsMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			if err = wnfc.check(); err != nil {
				return nil, err
			}
			wnfc.mutation = mutation
			if node, err = wnfc.sqlSave(ctx); err != nil {
				return nil, err
			}
			mutation.id = &node.ID
			mutation.done = true
			return node, err
		})
		for i := len(wnfc.hooks) - 1; i >= 0; i-- {
			if wnfc.hooks[i] == nil {
				return nil, fmt.Errorf("ent: uninitialized hook (forgotten import ent/runtime?)")
			}
			mut = wnfc.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, wnfc.mutation); err != nil {
			return nil, err
		}
	}
	return node, err
}