nestedmutations

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package nestedmutations is a built-in plugin exercising every hook surface: it adds nested `create`/`connect` input fields on create-mutation inputs following foreign keys (SchemaHook), compiles them into a single multi-CTE SQL statement respecting FK direction and insertion order (CompileHook), and forces a transaction for nested mutations even when transactions are globally disabled (RequestHook), unless plugins.nested-mutations.force_transactions is false.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func New

func New(settings map[string]any) *Plugin

New builds the plugin from its `plugins.settings.nested-mutations` map.

func (*Plugin) AfterOperation

func (p *Plugin) AfterOperation(context.Context, *exec.Operation, *exec.Result)

func (*Plugin) BeforeOperation

func (p *Plugin) BeforeOperation(ctx context.Context, op *exec.Operation) (context.Context, error)

BeforeOperation forces a transaction when the operation uses nested mutation inputs (unless force_transactions is disabled).

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Priority

func (p *Plugin) Priority() int

func (*Plugin) TransformSchema

func (p *Plugin) TransformSchema(_ context.Context, b *schema.Builder) error

func (*Plugin) WrapCompile

func (p *Plugin) WrapCompile(next compile.Func) compile.Func

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL