From b0e43f01f05f2dac7c79589737b522278c40bb20 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Sun, 17 May 2020 17:58:22 +0300 Subject: [PATCH] entc/mutation: avoid generting empty switch statements for edges (#493) --- entc/gen/internal/bindata.go | 4 +- entc/gen/template/builder/mutation.tmpl | 92 ++++++++++++---------- entc/integration/config/ent/mutation.go | 8 -- entc/integration/ent/mutation.go | 24 ------ entc/integration/gremlin/ent/mutation.go | 24 ------ entc/integration/json/ent/mutation.go | 8 -- entc/integration/migrate/entv2/mutation.go | 16 ---- entc/integration/template/ent/mutation.go | 8 -- examples/entcpkg/ent/mutation.go | 8 -- 9 files changed, 52 insertions(+), 140 deletions(-) diff --git a/entc/gen/internal/bindata.go b/entc/gen/internal/bindata.go index 9f5f7e347..c4682232c 100644 --- a/entc/gen/internal/bindata.go +++ b/entc/gen/internal/bindata.go @@ -186,7 +186,7 @@ func templateBuilderDeleteTmpl() (*asset, error) { return a, nil } -var _templateBuilderMutationTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x5b\xdb\x73\xdb\x36\x97\x7f\x26\xff\x8a\x53\x4e\xda\x11\xbd\x2a\xd5\x7e\x6f\x9b\xae\x1f\xb2\x71\xfb\xad\x67\x76\xe3\x9d\x2f\xee\xbe\x64\x32\x5f\x11\x12\xb2\x30\xe1\x45\x25\x20\xd9\x1e\x55\xff\xfb\xce\x39\x00\x48\x80\x37\x51\x8a\x9b\xed\xf6\xa1\xb1\x49\x10\x38\x97\xdf\xb9\xc3\x87\xc3\xea\x2a\x7c\x5b\x6d\x9f\x6b\xf1\xb0\x51\xf0\xb7\x1f\x7e\xfc\xd7\xef\xb7\x35\x97\xbc\x54\xf0\x0b\x4b\xf9\xa7\xaa\xfa\x0c\xb7\x65\x9a\xc0\x9b\x3c\x07\x5a\x24\x01\xdf\xd7\x7b\x9e\x25\xe1\xfd\x46\x48\x90\xd5\xae\x4e\x39\xa4\x55\xc6\x41\x48\xc8\x45\xca\x4b\xc9\x33\xd8\x95\x19\xaf\x41\x6d\x38\xbc\xd9\xb2\x74\xc3\xe1\x6f\xc9\x0f\xf6\x2d\xac\xab\x5d\x99\x85\xa2\xa4\xf7\xff\x79\xfb\xf6\xe7\x77\xef\x7f\x86\xb5\xc8\x39\x98\x67\x75\x55\x29\xc8\x44\xcd\x53\x55\xd5\xcf\x50\xad\x41\x39\x87\xa9\x9a\xf3\x24\xbc\x5a\x1d\x8f\x61\x78\x38\x40\xc6\xd7\xa2\xe4\x10\x15\x3b\xc5\x94\xa8\xca\x08\xcc\x8b\x57\xdb\xcf\x0f\xf0\xfa\x1a\x3e\x31\xc9\xe1\x55\xf2\xb6\x2a\xd7\xe2\x21\xf9\x6f\x96\x7e\x66\x0f\x1c\x17\x1d\x0e\xa0\x78\xb1\xcd\x99\xe2\x10\x6d\x38\xcb\x78\x1d\xc1\x2b\xfa\x5c\x14\xdb\xaa\x56\xb0\x08\x83\x48\x3e\x97\x69\x14\x86\xc1\xe1\xf0\x3d\xd4\xac\x7c\xe0\xf0\xaa\xc4\x6d\x5f\x25\xef\xaa\x8c\x4b\x5c\x1e\x04\x11\x9e\xd7\x3f\x62\x85\x8f\x4b\xe7\x41\xa4\xf7\xe1\x65\x46\xc7\x04\xd1\x83\x50\x9b\xdd\xa7\x24\xad\x8a\xd5\xda\xc8\x5c\x94\xe9\xee\x13\x53\x55\xbd\xe2\xa5\x8a\xc2\x38\x0c\xd3\xaa\x94\x44\xcc\x6a\x05\x77\x5b\x5e\x13\x9f\xa0\x9e\xb7\x5c\x26\x61\x70\xb7\x7d\x5b\x73\xe4\x01\x00\xae\x81\x97\x2a\xb1\x4f\xf0\xdd\x0d\xcf\xb9\xff\x4e\x3f\x69\xdf\xdd\x95\xbc\xf3\xee\xae\xa4\xd7\xbf\x6e\xb3\xce\xb6\xfa\x49\xfb\xce\xfd\xb4\x79\x12\x12\x9d\x28\x9c\x86\xc4\x49\xd9\xdd\x3f\x6f\xb9\x96\xd3\x3b\x56\xa0\x90\xe0\x1a\x22\xef\x81\x2f\xb5\x98\xb4\x3b\xb2\x1d\x29\xde\x42\x81\xde\x95\xc9\x7f\x99\x5f\xcd\x6e\xe1\x6a\x05\xde\xaa\xe3\x11\x6a\x6e\x90\x2f\x81\x95\x50\xb5\x32\xde\x30\x05\xb4\x90\x13\x32\x0f\x07\xd8\xe6\xbb\x9a\xe5\x0e\x75\xb8\x5f\x49\xe7\x1b\xf8\x3e\xd4\x6c\xbb\x49\x42\x64\xbe\x77\x90\x54\xf5\x2e\x55\x70\x08\x83\x94\xc0\x12\x06\xd5\x16\xee\xb6\x61\xa0\x9e\xb7\xf8\x52\x94\x0f\xc8\x2c\x6e\x7f\x7b\x93\xfc\xfb\x4e\xe4\x19\xaf\x7f\x11\x3c\x47\xd6\xe1\xaa\x79\x83\x42\x23\xf1\x39\xa2\x5d\x1b\x7e\x69\xb9\x11\x2e\x7e\xb0\x1e\xde\x67\xdd\x6e\x42\xbb\x88\xb5\x7d\x96\xbc\xdb\x15\xbc\x16\xa9\x7e\x17\xb0\x2c\x3b\x63\x1b\xa3\x25\xef\xe7\x34\xe7\xac\xe6\x99\x21\xac\x60\xdb\x0f\x9a\xd5\x8f\x5a\x1c\x07\x9f\x0f\x6e\xf8\xf8\x39\x7b\xe0\xd2\xa7\x8f\x27\xbf\x96\xe2\xf7\x1d\x1d\x07\xce\x7f\x48\x08\x1f\xa6\x8f\x6b\x96\x5c\x99\x05\x96\xa0\xe1\xcf\x3e\x55\x55\x6e\x99\xc9\xe5\xcc\xb3\x90\xa9\xc1\xe3\x1c\x1e\x83\xa0\xe6\x45\xb5\x1f\x3b\x77\xd6\x16\x63\x22\xae\xf2\xec\x7f\x58\xbe\xe3\xb0\xde\x95\xe9\x22\xad\x4a\xc5\x9f\x14\x7a\x24\xfc\x37\x86\xc5\x95\x67\x51\x4b\xe0\x75\x5d\xd5\x71\x78\x0c\xc3\x3d\xab\xe1\x9f\x64\xc4\xd6\x50\xe0\xda\xac\x77\x90\x1b\x2f\x4a\x91\xc7\xbe\x7d\xdd\x6d\xad\x95\x6d\x6b\x51\x2a\x58\xa4\xac\xe0\x8d\x69\xc4\x10\xe9\x05\xd1\x80\xd1\x99\x4f\x8f\x47\x60\x79\x5e\x3d\x4a\x50\x15\x14\xac\x44\x2f\x89\x26\xd4\x1c\xac\xad\x64\x67\xcc\x71\x27\x45\xf9\x40\x1c\xe2\xaf\x2c\x87\x8a\xb6\x91\x03\xc6\xd6\x1e\x40\x02\xe9\xb1\x13\x92\xd9\xf2\xc7\xae\x81\xa6\xe4\x39\x25\xbe\x6a\xa9\x58\x57\xb5\xe5\x2a\x09\x71\xbf\x81\x2f\x17\xa9\x21\x76\x09\x64\xd2\xf8\x8f\x92\x90\x24\xc9\x20\x59\x31\x74\x49\x42\xa7\x50\xa0\x30\xbf\xeb\xbc\x38\x84\x81\xf1\x16\xaf\x2d\x06\xd3\x65\x18\x04\xd5\xf6\xb5\x8b\xcb\x6a\x8b\x0f\xd5\xb3\xf7\xb4\xe7\x5c\x71\x8d\x67\x8e\xaf\xa1\x60\x9f\xf9\x62\xc0\x28\xe3\x65\x18\x1c\xc3\x00\x99\xff\x27\x71\x83\xc4\x69\x1b\x25\xd6\x0e\x44\x83\x5a\x14\x31\xad\xab\xb9\xda\xd5\x25\x14\xa1\xf1\xc2\xe6\x03\x0d\x8d\xe8\x51\xa8\x4d\xd4\xd0\x11\xdd\xde\xb8\xa8\xc0\xa5\xe8\x1c\xb9\x92\xa4\x7e\x91\xc1\x9a\xac\x82\x42\x7f\x0b\x07\x23\xfc\xf6\x93\x85\xc8\xa0\xeb\x13\xe3\x11\x1c\x1c\x1a\x12\x09\x11\x45\x4f\x01\x31\x71\x84\xe6\xb0\x40\x5b\xe5\x75\xad\xad\x04\x7f\xa9\xca\x94\x03\xa6\x02\xc9\x5d\x99\x72\x7c\xb2\x27\x6b\xf3\xcd\x2a\x0c\x82\x38\x0c\x82\x22\x69\xac\xf1\xda\xd8\xa3\x7a\x82\xb9\x36\x49\x54\xd0\x81\xc9\x4d\xb5\xa0\xcf\xcd\x33\x7d\x26\xad\x83\x6b\x28\x92\xb7\xb9\xe0\xa5\x5a\xc4\x89\xb7\x4f\xf2\x77\xae\xf0\xc0\x25\x88\x0c\xa9\x09\x8e\xb1\x76\x3d\xc4\x7b\xbb\x45\x18\xa0\xd6\x82\x22\x19\x0d\x37\xd7\xf0\x9d\xc8\x50\xb7\x8e\x46\x47\x14\x3a\xae\xcb\x2a\xb7\x2a\xb2\xe1\xfd\xa4\x52\x31\x9a\x76\x24\xfb\x85\x4a\x1d\xd0\xc8\x59\xda\x30\x67\x20\x61\x4b\x28\x45\x3e\x4b\x76\xb8\x3a\xb9\xbd\x31\x02\x5c\xad\x40\xeb\x0b\xf4\x66\x12\x18\x39\x99\xdf\xd0\xf3\xea\x37\xbf\xc1\xba\xae\x0a\x5f\x38\x70\xeb\x4b\x0b\x1e\x99\xc4\xbd\xf8\x13\x4f\x77\x8a\x67\x98\x74\x30\x50\x35\x2b\x25\x23\xaf\x08\x0b\xdc\xf0\xfe\x29\x5e\xfa\xcf\x59\x0e\xa9\x3e\x5f\x48\x43\x02\xa6\xf1\x24\xfb\x45\xd1\x4d\x54\x62\xb0\xe0\x82\x2b\x43\x36\xe6\x2c\xfa\x27\xf4\x51\xfa\xe1\xc1\xfa\xa5\x22\xd1\x3f\x1d\xed\xa2\x44\x94\x42\x2d\xe2\x46\x3d\xfa\xa9\x11\xc4\xfd\x53\x2b\x84\x52\x4b\xe0\xfe\xe9\x37\x72\xb3\x96\x06\xa9\x73\xaf\x47\x5e\x73\x8f\x57\x87\x23\xf9\x13\xee\x25\x94\xbb\x17\x29\x0d\x2a\xb5\xe1\xf5\xa3\x90\x7c\x82\xbf\xfb\xa7\x05\x2a\xfd\xfe\xc9\xd5\xb4\x58\x43\x80\xbe\xee\x33\xf2\x58\x24\x59\x2d\xf6\xbc\x4e\x16\x57\xea\xe9\x86\x7e\x8c\x7f\x82\x6f\xaa\xcf\x84\x09\x0b\x09\x91\x2f\x61\x5d\xa8\xe4\x67\xdc\x64\xbd\x88\x6c\xe5\x71\x3c\xbe\x6e\x95\x26\x24\x94\x95\x82\x7a\x57\x96\x18\xc1\xba\x3a\x8b\xb4\x07\x55\x4f\x24\xda\xfb\xa7\x21\xb1\xaa\xa7\xae\x48\xd1\xc4\x11\x8b\x64\x9d\x3a\x3f\x22\x28\xfe\x2a\x79\x7d\x43\x55\x91\x4e\x0d\x56\x2b\x78\xcf\xd5\xed\x4d\x6b\x93\xda\x77\x19\x3b\xb4\xce\x36\x81\x77\x15\xa5\xb9\x4c\x2d\xa9\xe0\xa2\x2f\xdb\x5c\x58\x48\x60\x69\xca\xb7\xa8\x88\xaa\xcc\x9f\xa1\x2a\x3b\x86\x4d\xb1\x93\x2c\x3a\xb0\x62\xef\x9b\x23\x91\x32\xe2\xb7\x67\xba\x23\xb7\x84\x5a\xad\xe0\xf6\xa6\x41\x80\xe1\x47\xf3\x67\xd2\xf1\xd6\x94\x3c\xfe\x70\x21\xe1\x47\x02\xdb\x33\x91\xb3\x4f\x39\xd7\x7c\x89\x35\x82\xea\x91\x49\xd8\xd6\xd5\x5e\x64\x3c\xc3\xec\x04\xbf\xf8\xa4\x29\x6a\x51\xd5\x67\xef\xf6\x06\x61\x35\xc0\xde\x12\xf8\x93\x90\x4a\x52\x7a\x69\xc1\x36\xc5\xed\x35\x2a\xd7\x81\x9a\x1b\x64\xaf\xc6\x3f\x5c\x82\xaa\x77\xdc\xb8\xec\xf1\xca\x80\x60\x4a\x01\x9d\xa7\x1c\xa1\xdd\x24\xff\xef\x29\x0b\xc0\xbc\xe3\x80\xa2\xe0\xbf\xe3\xc2\xa8\x88\xc8\xdd\xd2\x57\xd7\x10\x91\x84\xed\xa3\x36\x1f\x85\x57\x24\x99\x36\xec\xbf\xe7\x2a\xc2\x9d\xdf\x53\x4e\x61\x69\xd4\x4b\x75\x59\xdb\xac\x75\x0a\xe5\x28\xa1\x8f\xde\xe2\x02\x56\x2a\x8b\xe2\x66\x7f\x37\xbe\xe8\x1a\xc4\x42\x50\x23\x79\x0a\x7f\xce\x26\x0b\xcd\x8e\xe1\x6b\x3d\x04\xc4\x7e\xd1\x63\xf2\xb3\x6d\x5b\x98\xac\xae\x90\x1a\x85\x42\x2b\x4d\xe1\x44\xe9\x68\xb5\xe7\x75\x2d\x32\x0e\xdb\x9a\xef\x45\xb5\x93\x90\xb2\x3c\xa7\x54\xf7\x4d\x96\x25\x40\x2d\x8c\x13\xb5\x57\x91\x8c\x56\x5f\xd7\x26\x10\xb9\x55\xc0\x31\x6c\x05\xd5\xa4\xf3\x7f\xe7\x4a\xd7\xb8\xad\x8d\xf8\x42\x1b\x36\x97\x93\x42\xec\x1c\x80\xb8\xaf\x7d\x49\xf6\x31\x1f\xec\xb5\x67\x1d\x64\x29\x0c\xd0\x26\xf6\x2e\xf4\x1b\xec\x53\xbc\xb5\xe8\xdf\x1b\x90\x8f\xf2\x7b\xa7\x45\xe4\xb2\x6c\xf3\x90\x0e\xdb\x4b\xc2\x38\x51\x99\xd0\x5e\x6f\x6c\x10\x71\xc2\x24\xae\xf1\x82\xb0\xe7\x15\xd1\xb3\x37\xdd\x8f\x25\x54\x35\x64\x4c\x31\x6a\x3b\xfd\xbe\xe3\xf5\x33\xac\x99\xc8\xe5\x79\xf2\xd4\x0c\x8c\xe4\x8d\x7b\xd0\xa6\x89\xbc\x88\x5c\x7b\xae\xe3\xf1\xaa\xb1\xc4\xae\x0e\x6c\x22\xab\x35\x20\xd6\xf0\x4d\x91\x54\xdb\xe4\x56\x2e\x9c\xb6\x8d\x9f\xe9\xec\xfb\x41\x6d\x48\xc0\xe8\x3c\xb1\x7e\x73\x42\x42\xdb\x19\x6a\x84\x24\x31\xbe\x05\x46\xbd\xa7\x5d\xde\x1f\x7f\x80\x9b\xaf\xf5\xc0\x30\x97\xb8\x9a\xff\xbe\x13\x35\xa7\xbc\xe0\xf6\xc6\x54\x14\x1d\x94\x37\x94\xd9\xf3\xb4\xb8\x08\xa3\xf6\x11\x6a\x21\xd6\xc4\xe3\xbb\x6f\x4e\x12\x44\x5a\x47\x77\x80\x98\xd3\xc6\x85\xa9\xcd\x08\x9d\xaf\xe1\xdb\xc7\x88\x8e\x8d\x7d\x98\xdb\xf3\x8d\xb1\xf8\x2e\xd4\xa4\xa1\x47\xea\x4c\x22\x18\x58\x99\x0d\xfb\x90\x01\xaf\xfc\x26\xcb\x06\xbd\x72\xd7\xc9\xb2\x2c\x93\xd0\x38\x49\x55\xf9\x06\x94\x84\xc1\x0b\xf8\x59\x8d\x89\x51\x2f\xe7\x4a\x3b\xb8\x9a\x58\xf8\x2f\xd7\xe0\xf8\xe5\xe0\xa8\x7b\x37\xfa\xbb\x49\x2f\xfa\x9d\xf7\x19\xa9\x40\x4b\xe2\x4d\x96\xf1\x6c\x48\xf6\x9e\x5f\xd1\xfa\xd5\xc9\x2a\x93\x28\xb2\x36\x5f\x18\x88\x4d\x1a\x80\x42\xba\x7e\x76\x42\x8a\xa3\x34\xcc\xf3\xb6\xd6\xdd\x8e\xb1\x6f\xe4\xef\xbb\xdc\xd6\xe7\x06\x47\x07\xe4\xad\xd7\x0d\x74\x00\x6f\xba\xd8\x8d\x37\xd2\x75\x19\xcb\x47\x81\xf7\x36\xe7\xac\x9e\x05\x3d\xea\x51\x74\xb2\xd5\x0b\xd1\x67\x44\x31\x1e\xd0\x75\x1c\x9d\x0e\xc4\x73\x22\xb1\x17\x8a\xf1\x0b\xaf\xd1\xf2\xa1\xcd\x79\x8e\xc7\x8f\x70\x0d\xb6\xcf\x72\x68\x40\xd7\x50\xdd\xe4\x44\xbe\xa0\xb4\xfc\x78\x16\x0d\x8a\xcc\xa2\xd2\x04\x2b\x0d\x37\x1f\x82\x88\x50\x43\xd4\x99\x40\xf4\x05\x8a\x08\xd3\x52\x75\xaa\xa5\x09\x6e\x1d\x18\x55\x9f\x07\x01\x64\xf9\x76\x3c\xe4\x3f\xb8\xe4\x83\xb9\x5f\x4d\x2f\x58\x9e\x43\xba\xc1\x04\x57\xda\x52\x26\xf2\xb8\x8d\xce\xcc\x06\x4f\xe5\x7d\x6d\xba\xf5\x52\xe9\x9a\xb3\x99\x6f\x3a\x41\x46\x83\x98\x45\x47\xa8\x4b\x70\xa5\x1a\xf7\x92\x3f\x47\xa6\x4e\xf6\xdf\xef\xa7\xeb\x5e\x0b\x3e\x8e\x58\x46\x68\x32\x26\xec\xf4\xd7\xcd\x9a\x6b\x88\x24\xe6\xf0\xf4\xc0\x4d\xf4\x45\x26\x7f\xf1\x8c\x7b\xb1\x65\x32\x65\x39\x7e\x15\xc3\x42\x8a\xf2\x61\x97\xb3\x1a\xf7\x24\x7d\xfc\x01\xfa\x7d\x0c\xd1\xed\x8d\x1c\x3f\xd3\xee\x3b\xbc\xad\xfd\x85\xdb\x16\xb3\x6e\x24\x3a\xb4\x19\xac\xd8\x6d\x4c\xd0\xa9\xd0\xc1\xb7\xb9\x2f\x6f\x2c\x82\x67\x0f\xdc\x46\x36\xd3\x78\xb7\xaf\x3e\x3d\x83\xc8\x34\x91\x98\xe2\xb9\x84\xca\xe6\xc0\x93\xe8\x6a\x09\x59\xf4\x19\xa6\xfd\xcd\x90\x41\x64\xb6\x5b\xac\x77\x86\xc1\x59\x80\x06\xe9\xd0\x3c\xa4\x71\x71\xfd\xc9\x82\xa9\x9c\xbd\x91\x46\xe0\x64\x63\x03\x5f\xb8\xf1\x60\x7c\xdb\xa6\x75\x3c\x3d\xb7\x88\x9b\x58\x82\x79\x90\x68\xfb\xc8\xc8\xf3\xe4\x19\x1f\x44\x26\x3f\x88\x8f\x3d\x77\x19\x74\x67\x21\xc7\x26\x0c\xf9\x32\x99\x08\x42\xfc\x9c\x20\x34\x17\x35\x17\x84\xa5\xc9\x61\xd4\x75\x1b\x73\x07\x03\x04\xbf\x3c\x40\x10\x13\x3e\x5f\x4e\x7c\xb8\x2c\x1c\xd8\x21\xc0\x24\x53\x4e\x8e\xa5\xdf\xfb\x7a\xe8\xf4\x73\x7c\x0a\x45\x2f\x85\x3f\x4d\x68\xff\x00\xa7\x47\xd3\x43\xed\x50\x1a\x35\x61\x29\xdf\xf4\x33\x27\xdb\x9e\xe9\x2d\x6e\x12\x28\x37\xb1\x6a\xc3\x61\x63\x99\x4d\x73\x06\x4b\xab\x1a\x16\xa4\xeb\x35\x44\xdf\x26\x3f\xca\xc8\x43\x5c\xdc\x7e\xd0\x73\xc8\xd1\x3f\x68\xda\x18\xcd\x72\xc6\xad\x3a\x1c\xcf\xa9\xc7\x95\x97\xb8\x4d\x79\x5a\x2b\x8e\x63\x6c\x5d\xdf\x98\xc3\xd3\x1a\x98\x1c\x9f\x76\x5c\xd6\xf4\xda\xf3\x3d\xd7\x88\xcb\x3d\x71\xd2\x07\x91\xf5\x7d\x57\xc7\x0d\x8f\x3b\xc5\xd3\x9b\x0f\x3b\xc7\x96\xe2\x26\xd3\xf0\xdd\x47\x17\x23\xd9\x2c\x77\xe8\x5a\xa5\xa1\x8b\x88\x35\xa9\xf9\xf9\x3e\xf0\xf6\x46\x6a\x4b\x94\xf0\xe1\xe3\x94\xf6\x49\x42\x59\x2b\xa2\x13\xea\xd5\xd2\xc3\x6d\xaf\x81\x6d\xb7\xbc\xcc\xf0\x8c\x76\x20\x36\x64\x7c\x36\x17\x1d\x75\x4a\x72\xd2\x2b\xc9\xbe\x5b\xd2\x97\x05\x86\x50\x43\xf7\x63\x4c\x2f\x9a\xbe\x65\xf9\x23\x7b\x6e\x0f\xc8\x79\x89\x04\xc7\xf0\x6f\xd7\xf0\x23\xf5\x0e\x76\xfa\x6b\x34\x3b\xb9\xa4\x5a\xff\xb9\xda\x81\xdc\x54\xbb\x3c\x83\x9d\xe4\x93\xde\x54\x94\x52\x71\x96\x25\x70\xab\xac\x6f\xa3\x6e\x0d\x49\xb5\x54\xbc\xc6\xbc\x73\x27\xd9\x03\x47\xe3\x75\x1a\xdd\xf6\xee\x8e\x45\xd1\xb9\x6e\x76\x8e\x76\x51\x4a\x63\xc6\x25\xd6\x46\xeb\x23\xfe\xf4\x27\x7c\xed\x39\xe0\xbe\xce\xaf\x1c\xa5\x77\x0c\xaf\x8f\xaa\x8b\xe1\x64\xa4\x74\x3c\x7a\xed\xfa\xd0\xef\x89\xbf\xe2\x5f\x5a\xdb\xf0\xb6\xb6\x41\x28\x5c\x54\xda\x0c\x79\x43\xbf\xb4\xe9\x65\x95\x27\x32\x94\x35\xcb\x09\x81\x1d\xf1\x9e\xf4\xc1\x43\xfd\x6b\xb7\x84\xa1\xeb\x6e\x7e\x13\xb7\xe9\xbb\x96\xed\x5d\x8c\x41\xee\xef\xb6\x0b\xfc\x9f\x33\x20\x2e\x92\x6a\x6b\xe7\x8f\x08\x3f\x77\xdf\xd2\xde\x56\x6b\x2e\x1b\x36\x9b\x2d\x0e\xde\x1c\x7a\xea\x4c\xdc\x76\x11\x9b\x6b\x5c\xde\xc9\xea\xd9\x1e\x6d\x46\x30\xcd\xc8\x32\xcf\x75\x95\xea\xce\x3b\xb5\xe6\x33\xc8\x76\x74\x1f\x6c\xb5\xea\x14\xea\xee\x20\x4b\x94\x50\xd5\x74\xd9\xb2\x82\x07\x83\x1c\x33\x85\xc0\x0f\x7b\x7b\x8b\x72\x95\xf1\xb4\xe6\x05\x2f\x15\xcf\x96\x34\x92\xd0\x5d\x26\x4d\xd9\x62\x92\x43\xbb\x06\x3e\x7c\x6c\xb9\x34\x67\xbc\x36\x41\xd5\xbe\x5a\xc2\x0f\x54\xaf\xe6\xbc\xf4\x66\x4f\xf1\x8c\x4b\x6b\xdf\x9f\x3b\x1d\x6a\x33\xb4\xe9\x16\xa2\xa1\xb5\xb1\xe3\xf5\x48\x5d\xdd\xb9\x5d\x65\xef\x18\xd0\x6a\x57\x93\x03\xad\xc0\x6a\x0d\xcc\x34\x5f\x1e\x85\xda\xe8\x2b\x81\x62\xcf\x2d\x66\x11\x7f\x1b\x0e\x92\xa7\x55\x99\x51\x92\xc9\x59\xd9\xcc\x60\x32\x91\xd2\xfd\x23\xd2\x18\xa9\xdd\x6c\xa5\xc7\xfe\x58\x88\x4a\xae\x68\xca\x80\xc9\x3a\xfe\x6e\x6e\xc0\x9a\xf8\x23\xd3\x0d\x2f\xd8\x49\x25\x2e\x90\x18\x03\xd5\x58\xdf\x19\x30\xfd\xef\x26\xed\x45\x01\x10\x07\x1d\xf5\xc8\x47\xa1\xd2\x0d\x71\xd3\x14\xa3\x13\xda\xbc\x48\x9d\x41\xca\x24\xf7\xb4\xf2\xda\x4d\xb0\x1b\x5d\x77\x47\x50\xdd\x06\xcb\xb0\x1e\xf5\xd0\x9e\xbc\x96\xf5\x33\x79\xd6\xd7\x67\xdb\xbe\xaf\xdc\x96\x5a\x73\x49\xc3\x8e\x79\x48\xa7\x5f\x3a\x37\xc2\x3d\x2a\x7d\x67\x5a\x4f\x8d\x4c\x0f\xb9\x99\x25\xa1\xba\xd7\x4c\xe4\xee\xad\x8d\x01\xbf\x67\x18\x19\x1a\x1d\x2d\x61\x54\xe9\xed\x7c\xe8\x52\xad\x27\x5f\x57\xdb\xed\x80\xec\x2c\x9d\x3b\x53\x9a\x5d\xf9\xb9\xac\x1e\xbb\x77\x18\xb4\x8a\xbf\x95\x91\x16\x56\x6c\x8c\xfd\x3d\x37\x69\x4d\xe7\x0e\xc5\xda\xa8\xcc\x31\x70\xcc\xb2\xda\x1b\x29\x74\x57\x47\xe3\xc2\xc5\x90\x70\x4d\x37\xf3\x6d\x97\x8c\x5b\xaf\x26\xdf\x8f\x61\xa9\x10\xb2\x60\x28\xff\x76\x0b\x7c\x3e\x85\x04\x4b\xb2\x6b\xe9\x4b\x43\x76\xa3\xf9\xd8\x10\x77\x08\xbb\x0a\xfe\x13\x7c\xf4\xb0\x96\xf7\xb6\x83\x4c\xa4\x25\x0b\x7f\x46\x64\xd2\x40\x7b\xeb\xa6\xc1\x84\xaf\x49\xfe\xb4\xe5\xa9\xe2\x5a\x28\xf0\xed\x3d\xe9\xc5\x51\xa5\x19\xf5\x6a\x8d\xda\x0a\xa0\x48\xde\x73\x35\x38\x5b\xd9\xbb\x37\xe6\x28\x4b\xe9\xb4\x9a\x06\x89\x38\x03\x4e\x4e\xc0\xf5\x52\x01\x7b\x7f\x60\x20\x6c\x37\x31\xdb\x38\x0a\x27\x8a\x9b\x44\xa1\xdb\xce\x3f\x31\x55\x1a\x8c\xe5\xed\x45\xa2\xff\x60\xd2\xeb\x6d\xef\x59\x6d\xc9\xb2\x1f\xcc\xf4\xfd\xe3\x33\x95\x8b\x7c\xc5\x39\x03\xc3\xd9\xf1\x7e\xa8\x64\xf6\x7e\xf1\x33\x80\x4e\xaa\x3b\x82\x94\xae\xae\xfd\x94\xd3\x88\xa2\x33\x3f\xf4\xf3\x33\x4a\xe1\x30\xdc\x4c\x65\x14\x6e\x3a\xd1\x49\x23\x74\xee\xd8\xcb\x24\x5e\x24\x8d\x68\xf9\x9a\x99\x4b\x0c\xe3\xea\x92\x6c\xe2\xa5\x11\x35\x12\x7e\xda\xfc\x7d\x62\x0c\x3b\x0d\x9b\x39\xf9\x87\xc6\x88\xde\x91\x26\xee\xff\x2f\xc2\x8b\x25\x79\x6e\x78\x79\xc9\x6c\xf2\x6b\xe9\xff\x74\x68\xea\x04\xa7\x17\x0a\x4f\xc6\x1b\x61\x88\x7a\x93\x0d\xe3\x6e\x1f\x7b\x10\x1d\x1a\x40\xcf\x00\xe2\xe9\x00\xe6\x45\xa4\x4e\x20\xd3\x77\x9a\xdd\x3f\xed\xf1\x63\x99\xb9\x9a\xd4\xaf\x6f\xf5\x37\xf8\xf9\xb9\x91\xcb\x3b\x6e\x2a\x76\xf9\xf3\xd4\x2f\x0d\x5e\x9d\xe9\xec\x97\x04\x2e\x3a\xc1\xb0\xb1\xf0\xc2\xd0\x5f\x28\x66\xb9\x44\x3a\xf7\xd5\x6d\xb1\xda\x96\xa9\x62\x3d\x50\xa4\x8e\xdf\x30\x38\x51\x94\x5a\xb1\x78\xf1\xc4\x0e\x97\x46\x6f\x1a\xe0\xea\x8f\xa1\x73\xbf\xe0\xd8\x22\x53\xdb\x4b\xef\x32\xc9\x9f\xe1\x57\x4f\xc2\x76\x20\x56\x7a\xde\x71\x04\xbb\x97\x3b\xc8\x97\x41\xed\x98\x73\x2c\x12\xe2\x6a\x3c\x2a\x7e\x0d\xe7\xe4\xba\x98\x01\xef\x44\x6d\x56\x9b\x7b\x51\xe9\xe6\x76\x56\x3b\x1d\x7b\xa8\xf9\x03\xab\x33\xed\x8f\x28\x36\x6a\x78\xe8\xcd\x07\x40\x32\x8e\x10\x72\x6d\xe7\x82\xa4\x25\x76\x02\x24\x7f\xb5\x86\x4c\xb7\x34\xb7\x8d\x6d\x03\x01\x0f\x01\x2f\xa2\xf3\xa9\x8a\x4a\xdf\x70\x71\x83\x10\xcd\x29\x71\x9d\x1b\x7f\x24\x57\x2b\x7d\x4f\xcf\x78\x28\xdc\x60\x76\xdd\x44\x87\x74\x42\x0f\xcd\x65\x4e\x75\x40\xed\xfd\x9b\xf8\xd4\x5f\xbb\xce\x9c\x36\xcf\x51\x23\xef\xaa\x51\x53\xda\xc4\x16\x33\x50\x9a\xd7\xfe\xa4\xc5\xae\xbc\xdd\xa1\x18\x4a\x5b\x64\x12\x16\xaa\xd2\x7f\x7f\xa3\xff\x28\x3a\x76\xe4\xae\x65\xbe\xae\x6a\x5d\x96\x58\xf7\xdb\xe8\xe8\xa4\xe8\x6f\x6f\xa4\x6f\x1a\x1f\x3e\x36\xa9\xe6\x74\x0b\x63\xe4\x6f\x8a\xcf\x15\xdf\xb0\x11\x8c\x8d\x86\xcf\x1f\x5f\x59\x49\x3b\x7c\x1d\xae\x44\xd6\x1d\xea\x3a\xb3\x63\xe1\x75\xde\x9d\xd2\xeb\x87\x25\x8d\x11\x47\x8e\x8e\xe3\x76\xf2\x3c\x7b\x02\x36\x3e\x02\x33\xf9\xaa\xa1\x5e\x60\xb6\x31\xfe\xa7\xca\x5e\x1d\x64\xe0\x64\xc6\xd0\x33\x0d\xb8\x19\x3e\x9f\x67\xbe\xee\x21\x7f\xaa\x01\x1b\x40\x74\x6f\x8d\xcd\xbb\xc7\xe0\x01\xe2\x22\x1b\x9f\x69\xe4\xbd\x3b\x54\x27\x4c\xde\x88\xef\x4c\xa3\xb7\xba\xba\xcc\xec\xdb\x33\x5f\xd6\xf0\x47\xb4\x73\x91\xb8\x47\x22\xe3\x69\xcb\x9c\x82\xc1\xa8\x81\xce\xb8\xf8\x70\x9e\x9d\x9e\x63\xa6\x26\x41\x9f\x69\xa6\x9d\x3a\x60\xae\x99\xba\x87\x7c\x0d\x33\x1d\x34\xd1\xc9\x91\xf7\x5f\xcf\x36\x91\xab\x73\xea\x35\xd2\xd7\x17\x94\x6b\xce\x79\xc3\xd5\xda\x25\x16\xf9\x67\x5a\xe3\xdc\x8b\x89\xa7\xad\xc1\xed\xdb\x91\x08\x90\x91\x97\x28\x31\x1b\x1b\xfa\xb2\x32\x13\xc9\x39\x59\x65\x3a\xc2\x9f\xa8\x1e\x06\x54\x35\x9a\xec\x5c\x66\x0d\x33\x8a\xcb\xee\xb5\xa2\xaf\x55\x5c\x3a\x57\xae\xfa\xe5\x06\x95\x39\xa4\xf8\xcb\xeb\xca\x36\x00\x4e\x95\x95\xb4\xea\x4b\xab\xca\x09\x4c\xfc\x1f\xe5\xcc\x36\xd3\x1c\xae\x1b\x5f\x62\xf4\xd6\x57\x9c\x73\xb7\xa8\xfd\xf1\x7f\x03\x00\x00\xff\xff\xfb\xfc\xbd\x85\x07\x4d\x00\x00") +var _templateBuilderMutationTmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x5b\x4b\x73\xdc\xb6\x96\x5e\x93\xbf\xe2\x84\xe5\xa4\x48\x4d\x87\x9d\xdc\xdd\x38\xa3\x85\xc7\x4a\xee\xa8\x6a\xc6\x9a\xba\x56\x66\xe3\x72\xdd\xc0\x24\x5a\x8d\x32\x1f\x1d\x02\xdd\x92\xaa\xd3\xff\x7d\xea\x1c\x00\x24\xc0\x57\x3f\xac\xb8\x72\xb3\x88\x25\x12\x04\xce\xe3\x3b\x6f\x68\xbf\x5f\x5e\x85\x6f\xeb\xcd\x73\x23\x1e\xd6\x0a\xfe\xf6\xc3\x8f\xff\xfe\xfd\xa6\xe1\x92\x57\x0a\x7e\x61\x19\xff\x54\xd7\x9f\xe1\xb6\xca\x52\x78\x53\x14\x40\x8b\x24\xe0\xfb\x66\xc7\xf3\x34\xbc\x5f\x0b\x09\xb2\xde\x36\x19\x87\xac\xce\x39\x08\x09\x85\xc8\x78\x25\x79\x0e\xdb\x2a\xe7\x0d\xa8\x35\x87\x37\x1b\x96\xad\x39\xfc\x2d\xfd\xc1\xbe\x85\x55\xbd\xad\xf2\x50\x54\xf4\xfe\xbf\x6f\xdf\xfe\xfc\xee\xfd\xcf\xb0\x12\x05\x07\xf3\xac\xa9\x6b\x05\xb9\x68\x78\xa6\xea\xe6\x19\xea\x15\x28\xe7\x30\xd5\x70\x9e\x86\x57\xcb\xc3\x21\x0c\xf7\x7b\xc8\xf9\x4a\x54\x1c\xa2\x72\xab\x98\x12\x75\x15\x81\x79\xf1\x6a\xf3\xf9\x01\x5e\x5f\xc3\x27\x26\x39\xbc\x4a\xdf\xd6\xd5\x4a\x3c\xa4\xff\xcb\xb2\xcf\xec\x81\xe3\xa2\xfd\x1e\x14\x2f\x37\x05\x53\x1c\xa2\x35\x67\x39\x6f\x22\x78\x45\x9f\x8b\x72\x53\x37\x0a\xe2\x30\x88\xe4\x73\x95\x45\x61\x18\xec\xf7\xdf\x43\xc3\xaa\x07\x0e\xaf\x2a\xdc\xf6\x55\xfa\xae\xce\xb9\xc4\xe5\x41\x10\xe1\x79\xc3\x23\x96\xf8\xb8\x72\x1e\x44\x7a\x1f\x5e\xe5\x74\x4c\x10\x3d\x08\xb5\xde\x7e\x4a\xb3\xba\x5c\xae\x8c\xcc\x45\x95\x6d\x3f\x31\x55\x37\x4b\x5e\xa9\x28\x4c\xc2\x30\xab\x2b\x49\xc4\x2c\x97\x70\xb7\xe1\x0d\xf1\x09\xea\x79\xc3\x65\x1a\x06\x77\x9b\xb7\x0d\x47\x1e\x00\xe0\x1a\x78\xa5\x52\xfb\x04\xdf\xdd\xf0\x82\xfb\xef\xf4\x93\xee\xdd\x5d\xc5\x7b\xef\xee\x2a\x7a\xfd\xeb\x26\xef\x6d\xab\x9f\x74\xef\xdc\x4f\xdb\x27\x21\xd1\x89\xc2\x69\x49\x9c\x95\xdd\xfd\xf3\x86\x6b\x39\xbd\x63\x25\x0a\x09\xae\x21\xf2\x1e\xf8\x52\x4b\x48\xbb\x13\xdb\x91\xe2\x2d\x14\xe8\x5d\x95\xfe\x8f\xf9\xd5\xec\x16\x2e\x97\xe0\xad\x3a\x1c\xa0\xe1\x06\xf9\x12\x58\x05\x75\x27\xe3\x35\x53\x40\x0b\x39\x21\x73\xbf\x87\x4d\xb1\x6d\x58\xe1\x50\x87\xfb\x55\x74\xbe\x81\xef\x43\xc3\x36\xeb\x34\x44\xe6\x07\x07\x49\xd5\x6c\x33\x05\xfb\x30\xc8\x08\x2c\x61\x50\x6f\xe0\x6e\x13\x06\xea\x79\x83\x2f\x45\xf5\x80\xcc\xe2\xf6\xb7\x37\xe9\x7f\x6e\x45\x91\xf3\xe6\x17\xc1\x0b\x64\x1d\xae\xda\x37\x28\x34\x12\x9f\x23\xda\x95\xe1\x97\x96\x1b\xe1\xe2\x07\xab\xf1\x7d\x56\xdd\x26\xb4\x8b\x58\xd9\x67\xe9\xbb\x6d\xc9\x1b\x91\xe9\x77\x01\xcb\xf3\x33\xb6\x31\x5a\xf2\x7e\xce\x0a\xce\x1a\x9e\x1b\xc2\x4a\xb6\xf9\xa0\x59\xfd\xa8\xc5\xb1\xf7\xf9\xe0\x86\x8f\x9f\xf3\x07\x2e\x7d\xfa\x78\xfa\x6b\x25\x7e\xdf\xd2\x71\xe0\xfc\x87\x84\xf0\x71\xfa\xb8\x66\xc9\x95\x59\x60\x09\x1a\xff\xec\x53\x5d\x17\x96\x99\x42\x9e\x78\x16\x32\x35\x7a\x9c\xc3\x63\x10\x34\xbc\xac\x77\x53\xe7\x9e\xb4\xc5\x94\x88\xeb\x22\xff\x3f\x56\x6c\x39\xac\xb6\x55\x16\x67\x75\xa5\xf8\x93\x42\x8f\x84\xff\x26\x10\x5f\x79\x16\xb5\x00\xde\x34\x75\x93\x84\x87\x30\xdc\xb1\x06\xfe\x49\x46\x6c\x0d\x05\xae\xcd\x7a\x07\xb9\x49\x5c\x89\x22\xf1\xed\xeb\x6e\x63\xad\x6c\xd3\x88\x4a\x41\x9c\xb1\x92\xb7\xa6\x91\x40\xa4\x17\x44\x23\x46\x67\x3e\x3d\x1c\x80\x15\x45\xfd\x28\x41\xd5\x50\xb2\x0a\xbd\x24\x9a\x50\x7b\xb0\xb6\x92\xad\x31\xc7\xad\x14\xd5\x03\x71\x88\xbf\xb2\x02\x6a\xda\x46\x8e\x18\x5b\x77\x00\x09\x64\xc0\x4e\x48\x66\xcb\x1f\xfb\x06\x9a\x91\xe7\x94\xf8\xaa\xa3\x62\x55\x37\x96\xab\x34\xc4\xfd\x46\xbe\x8c\x33\x43\xec\x02\xc8\xa4\xf1\x1f\x25\x21\x4d\xd3\x51\xb2\x12\xe8\x93\x84\x4e\xa1\x44\x61\x7e\xd7\x7b\xb1\x0f\x03\xe3\x2d\x5e\x5b\x0c\x66\x8b\x30\x08\xea\xcd\x6b\x17\x97\xf5\x06\x1f\xaa\x67\xef\xe9\xc0\xb9\xe2\x1a\xcf\x1c\x5f\x43\xc9\x3e\xf3\x78\xc4\x28\x93\x45\x18\x1c\xc2\x00\x99\xff\x27\x71\x83\xc4\x69\x1b\x25\xd6\xf6\x44\x83\x8a\xcb\x84\xd6\x35\x5c\x6d\x9b\x0a\xca\xd0\x78\x61\xf3\x81\x86\x46\xf4\x28\xd4\x3a\x6a\xe9\x88\x6e\x6f\x5c\x54\xe0\x52\x74\x8e\x5c\x49\x52\xbf\xc8\x61\x45\x56\x41\xa1\xbf\x83\x83\x11\x7e\xf7\x49\x2c\x72\xe8\xfb\xc4\x64\x02\x07\xfb\x96\x44\x42\x44\x39\x50\x40\x42\x1c\xa1\x39\xc4\x68\xab\xbc\x69\xb4\x95\xe0\x2f\x75\x95\x71\xc0\x54\x20\xbd\xab\x32\x8e\x4f\x76\x64\x6d\xbe\x59\x85\x41\x90\x84\x41\x50\xa6\xad\x35\x5e\x1b\x7b\x54\x4f\x70\xaa\x4d\x12\x15\x74\x60\x7a\x53\xc7\xf4\xb9\x79\xa6\xcf\xa4\x75\x70\x0d\x65\xfa\xb6\x10\xbc\x52\x71\x92\x7a\xfb\xa4\x7f\xe7\x0a\x0f\x5c\x80\xc8\x91\x9a\xe0\x90\x68\xd7\x43\xbc\x77\x5b\x84\x01\x6a\x2d\x28\xd3\xc9\x70\x73\x0d\xdf\x89\x1c\x75\xeb\x68\x74\x42\xa1\xd3\xba\xac\x0b\xab\x22\x1b\xde\x8f\x2a\x15\xa3\x69\x4f\xb2\x5f\xa8\xd4\x11\x8d\x9c\xa5\x0d\x73\x06\x12\xb6\x80\x4a\x14\x27\xc9\x0e\x57\xa7\xb7\x37\x46\x80\xcb\x25\x68\x7d\x81\xde\x4c\x02\x23\x27\xf3\x1b\x7a\x5e\xfd\xe6\x37\x58\x35\x75\xe9\x0b\x07\x6e\x7d\x69\xc1\x23\x93\xb8\x17\x7f\xe2\xd9\x56\xf1\x1c\x93\x0e\x06\xaa\x61\x95\x64\xe4\x15\x21\xc6\x0d\xef\x9f\x92\x85\xff\x9c\x15\x90\xe9\xf3\x85\x34\x24\x60\x1a\x4f\xb2\x8f\xcb\x7e\xa2\x92\x80\x05\x17\x5c\x19\xb2\x31\x67\xd1\x3f\xa1\x8f\xd2\x0f\xf7\xd6\x2f\x95\xa9\xfe\xe9\x60\x17\xa5\xa2\x12\x2a\x4e\x5a\xf5\xe8\xa7\x46\x10\xf7\x4f\x9d\x10\x2a\x2d\x81\xfb\xa7\xdf\xc8\xcd\x5a\x1a\xa4\xce\xbd\x1e\x79\xc3\x3d\x5e\x1d\x8e\xe4\x4f\xb8\x97\x50\xee\x5e\xa4\x34\xa8\xd5\x9a\x37\x8f\x42\xf2\x19\xfe\xee\x9f\x62\x54\xfa\xfd\x93\xab\x69\xb1\x82\x00\x7d\xdd\x67\xe4\xb1\x4c\xf3\x46\xec\x78\x93\xc6\x57\xea\xe9\x86\x7e\x4c\x7e\x82\x6f\xea\xcf\x84\x09\x0b\x09\x51\x2c\x60\x55\xaa\xf4\x67\xdc\x64\x15\x47\xb6\xf2\x38\x1c\x5e\x77\x4a\x13\x12\xaa\x5a\x41\xb3\xad\x2a\x8c\x60\x7d\x9d\x45\xda\x83\xaa\x27\x12\xed\xfd\xd3\x98\x58\xd5\x53\x5f\xa4\x68\xe2\x88\x45\xb2\x4e\x9d\x1f\x11\x14\x7f\x95\xbc\xb9\xa1\xaa\x48\xa7\x06\xcb\x25\xbc\xe7\xea\xf6\xa6\xb3\x49\xed\xbb\x8c\x1d\x5a\x67\x9b\xc2\xbb\x9a\xd2\x5c\xa6\x16\x54\x70\xd1\x97\x5d\x2e\x2c\x24\xb0\x2c\xe3\x1b\x54\x44\x5d\x15\xcf\x50\x57\x3d\xc3\xa6\xd8\x49\x16\x1d\x58\xb1\x0f\xcd\x91\x48\x99\xf0\xdb\x27\xba\x23\xb7\x84\x5a\x2e\xe1\xf6\xa6\x45\x80\xe1\x47\xf3\x67\xd2\xf1\xce\x94\x3c\xfe\x70\x21\xe1\x47\x02\xdb\x31\x51\xb0\x4f\x05\xd7\x7c\x89\x15\x82\xea\x91\x49\xd8\x34\xf5\x4e\xe4\x3c\xc7\xec\x04\xbf\xf8\xa4\x29\xea\x50\x35\x64\xef\xf6\x06\x61\x35\xc2\xde\x02\xf8\x93\x90\x4a\x52\x7a\x69\xc1\x36\xc7\xed\x35\x2a\xd7\x81\x9a\x1b\x64\xaf\xa6\x3f\x5c\x80\x6a\xb6\xdc\xb8\xec\xe9\xca\x80\x60\x4a\x01\x9d\x67\x1c\xa1\xdd\x26\xff\xef\x29\x0b\xc0\xbc\x63\x8f\xa2\xe0\xbf\xe3\xc2\xa8\x8c\xc8\xdd\xd2\x57\xd7\x10\x91\x84\xed\xa3\x2e\x1f\x85\x57\x24\x99\x2e\xec\xbf\xe7\x2a\xc2\x9d\xdf\x53\x4e\x61\x69\xd4\x4b\x75\x59\xdb\xae\x75\x0a\xe5\x28\xa5\x8f\xde\xe2\x02\x56\x29\x8b\xe2\x76\x7f\x37\xbe\xe8\x1a\xc4\x42\x50\x23\x79\x0e\x7f\xce\x26\xb1\x66\xc7\xf0\xb5\x1a\x03\xe2\xb0\xe8\x31\xf9\xd9\xa6\x2b\x4c\x96\x57\x48\x8d\x42\xa1\x55\xa6\x70\xa2\x74\xb4\xde\xf1\xa6\x11\x39\x87\x4d\xc3\x77\xa2\xde\x4a\xc8\x58\x51\x50\xaa\xfb\x26\xcf\x53\xa0\x16\xc6\x91\xda\xab\x4c\x27\xab\xaf\x6b\x13\x88\xdc\x2a\xe0\x10\x76\x82\x6a\xd3\xf9\xbf\x73\xa5\x6b\xdc\xce\x46\x7c\xa1\x8d\x9b\xcb\x51\x21\xf6\x0e\x40\xdc\x37\xbe\x24\x87\x98\x0f\x76\xda\xb3\x8e\xb2\x14\x06\x68\x13\x3b\x17\xfa\x2d\xf6\x29\xde\x5a\xf4\xef\x0c\xc8\x27\xf9\xbd\xd3\x22\x72\x59\xb6\x79\x48\x8f\xed\x05\x61\x9c\xa8\x4c\x69\xaf\x37\x36\x88\x38\x61\x12\xd7\x78\x41\xd8\xf3\x8a\xe8\xd9\xdb\xee\xc7\x02\xea\x06\x72\xa6\x18\xb5\x9d\x7e\xdf\xf2\xe6\x19\x56\x4c\x14\xf2\x3c\x79\x6a\x06\x26\xf2\xc6\x1d\x68\xd3\x44\x5e\x44\xa1\x3d\xd7\xe1\x70\xd5\x5a\x62\x5f\x07\x36\x91\xd5\x1a\x10\x2b\xf8\xa6\x4c\xeb\x4d\x7a\x2b\x63\xa7\x6d\xe3\x67\x3a\xbb\x61\x50\x1b\x13\x30\x3a\x4f\xac\xdf\x9c\x90\xd0\x75\x86\x5a\x21\x49\x8c\x6f\x81\x51\xef\x71\x97\xf7\xc7\x1f\xe0\xe6\x6b\x03\x30\x9c\x4a\x5c\xc3\x7f\xdf\x8a\x86\x53\x5e\x70\x7b\x63\x2a\x8a\x1e\xca\x5b\xca\xec\x79\x5a\x5c\x84\x51\xfb\x08\xb5\x90\x68\xe2\xf1\xdd\x37\x47\x09\x22\xad\xa3\x3b\x40\xcc\x69\xe3\xc2\xd4\x66\x82\xce\xd7\xf0\xed\x63\x44\xc7\x26\x3e\xcc\xed\xf9\xc6\x58\x7c\x17\x6a\xd2\xd0\x03\x75\x26\x11\x0c\xac\xca\xc7\x7d\xc8\x88\x57\x7e\x93\xe7\xa3\x5e\xb9\xef\x64\x59\x9e\x4b\x68\x9d\xa4\xaa\x7d\x03\x4a\xc3\xe0\x05\xfc\xac\xc6\xc4\xa4\x97\x73\xa5\x1d\x5c\xcd\x2c\xfc\xb7\x6b\x70\xfc\x72\x70\xd0\xbd\x1b\xfd\xdd\xac\x17\xfd\xce\xfb\x8c\x54\xa0\x25\xf1\x26\xcf\x79\x3e\x26\x7b\xcf\xaf\x68\xfd\xea\x64\x95\x49\x14\x59\x97\x2f\x8c\xc4\x26\x0d\x40\x21\x5d\x3f\x3b\x23\xc5\x49\x1a\x4e\xf3\xb6\xd6\xdd\x4e\xb1\x6f\xe4\xef\xbb\xdc\xce\xe7\x06\x07\x07\xe4\x9d\xd7\x0d\x74\x00\x6f\xbb\xd8\xad\x37\xd2\x75\x19\x2b\x26\x81\xf7\xb6\xe0\xac\x39\x09\x7a\xd4\xa3\xe8\x65\xab\x17\xa2\xcf\x88\x62\x3a\xa0\xeb\x38\x3a\x1f\x88\x4f\x89\xc4\x5e\x28\xc6\x2f\xbc\x46\xcb\x87\x2e\xe7\x39\x1c\x3e\xc2\x35\xd8\x3e\xcb\xbe\x05\x5d\x4b\x75\x9b\x13\xf9\x82\xd2\xf2\xe3\x79\x34\x2a\x32\x8b\x4a\x13\xac\x34\xdc\x7c\x08\x22\x42\x0d\x51\x67\x02\xd1\x17\x28\x22\x4c\x4b\xd5\xa9\x96\x66\xb8\x75\x60\x54\x7f\x1e\x05\x90\xe5\xdb\xf1\x90\xff\xe0\x92\x8f\xe6\x7e\x0d\xbd\x60\x45\x01\xd9\x1a\x13\x5c\x69\x4b\x99\xc8\xe3\x36\x3a\x33\x1b\x3c\x96\xf7\x75\xe9\xd6\x4b\xa5\x6b\xce\x66\xbe\xe9\x04\x39\x0d\x62\xe2\x9e\x50\x17\xe0\x4a\x35\x19\x24\x7f\x8e\x4c\x9d\xec\x7f\xd8\x4f\xd7\xbd\x16\x7c\x1c\xb1\x9c\xd0\x64\x4c\xd8\xe9\xaf\x9b\x35\xd7\x10\x49\xcc\xe1\xe9\x81\x9b\xe8\x8b\x5c\xfe\xe2\x19\x77\xbc\x61\x32\x63\x05\x7e\x95\x40\x2c\x45\xf5\xb0\x2d\x58\x83\x7b\x92\x3e\xfe\x00\xfd\x3e\x81\xe8\xf6\x46\x4e\x9f\x69\xf7\x1d\xdf\xd6\xfe\xc2\x6d\x8b\x59\x37\x12\x1d\xda\x0c\x56\xec\x36\x26\xe8\xd4\xe8\xe0\xbb\xdc\x97\xb7\x16\xc1\xf3\x07\x6e\x23\x9b\x69\xbc\xdb\x57\x9f\x9e\x41\xe4\x9a\x48\x4c\xf1\x5c\x42\x65\x7b\xe0\x51\x74\x75\x84\xc4\x43\x86\x69\x7f\x33\x64\x10\xb9\xed\x16\xeb\x9d\x61\x74\x16\xa0\x41\x3a\x36\x0f\x69\x5d\xdc\x70\xb2\x60\x2a\x67\x6f\xa4\x11\x38\xd9\xd8\xc8\x17\x6e\x3c\x98\xde\xb6\x6d\x1d\xcf\xcf\x2d\x92\x36\x96\x60\x1e\x24\xba\x3e\x32\xf2\x3c\x7b\xc6\x07\x91\xcb\x0f\xe2\xe3\xc0\x5d\x06\xfd\x59\xc8\xa1\x0d\x43\xbe\x4c\x66\x82\x10\x3f\x27\x08\x9d\x8a\x9a\x0b\xc2\xd2\xec\x30\xea\xba\x8b\xb9\xa3\x01\x82\x5f\x1e\x20\x88\x09\x9f\x2f\x27\x3e\x5c\x16\x0e\xec\x10\x60\x96\x29\x27\xc7\xd2\xef\x7d\x3d\xf4\xfa\x39\x3e\x85\x62\x90\xc2\x1f\x27\x74\x78\x80\xd3\xa3\x19\xa0\x76\x2c\x8d\x9a\xb1\x94\x6f\x86\x99\x93\x6d\xcf\x0c\x16\xb7\x09\x94\x9b\x58\x75\xe1\xb0\xb5\xcc\xb6\x39\x83\xa5\x55\x03\x31\xe9\x7a\x05\xd1\xb7\xe9\x8f\x32\xf2\x10\x97\x74\x1f\x0c\x1c\x72\xf4\x0f\x9a\x36\x46\x27\x39\xe3\x4e\x1d\x8e\xe7\xd4\xe3\xca\x4b\xdc\xa6\x3c\xae\x15\xc7\x31\x76\xae\x6f\xca\xe1\x69\x0d\xcc\x8e\x4f\x7b\x2e\x6b\x7e\xed\xf9\x9e\x6b\xc2\xe5\x1e\x39\xe9\x83\xc8\x87\xbe\xab\xe7\x86\xa7\x9d\xe2\xf1\xcd\xc7\x9d\x63\x47\x71\x9b\x69\xf8\xee\xa3\x8f\x91\xfc\x24\x77\xe8\x5a\xa5\xa1\x8b\x88\x35\xa9\xf9\xf9\x3e\xf0\xf6\x46\x6a\x4b\x94\xf0\xe1\xe3\x9c\xf6\x49\x42\x79\x27\xa2\x23\xea\xd5\xd2\xc3\x6d\xaf\x81\x6d\x36\xbc\xca\xf1\x8c\x6e\x20\x36\x66\x7c\x36\x17\x9d\x74\x4a\x72\xd6\x2b\xc9\xa1\x5b\xd2\x97\x05\xc6\x50\x43\xf7\x63\x4c\x2f\x9a\xbe\x65\xc5\x23\x7b\xee\x0e\x28\x78\x85\x04\x27\xf0\x1f\xd7\xf0\x23\xf5\x0e\xb6\xfa\x6b\x34\x3b\xb9\xa0\x5a\xff\xb9\xde\x82\x5c\xd7\xdb\x22\x87\xad\xe4\xb3\xde\x54\x54\x52\x71\x96\xa7\x70\xab\xac\x6f\xa3\x6e\x0d\x49\xb5\x52\xbc\xc1\xbc\x73\x2b\xd9\x03\x47\xe3\x75\x1a\xdd\xf6\xee\x8e\x45\xd1\xb9\x6e\xf6\x14\xed\xa2\x94\xa6\x8c\x4b\xac\x8c\xd6\x27\xfc\xe9\x4f\xf8\xda\x73\xc0\x43\x9d\x5f\x39\x4a\xef\x19\xde\x10\x55\x17\xc3\xc9\x48\xe9\x70\xf0\xda\xf5\xa1\xdf\x13\x7f\xc5\xbf\xb4\xb6\xe1\x5d\x6d\x83\x50\xb8\xa8\xb4\x19\xf3\x86\x7e\x69\x33\xc8\x2a\x8f\x64\x28\x2b\x56\x10\x02\x7b\xe2\x3d\xea\x83\xc7\xfa\xd7\x6e\x09\x43\xd7\xdd\xfc\x26\x6e\xdb\x77\xad\xba\xbb\x18\xa3\xdc\xdf\x6d\x62\xfc\x9f\x33\x20\x2e\xd3\x7a\x63\xe7\x8f\x08\x3f\x77\xdf\xca\xde\x56\x6b\x2f\x1b\xb6\x9b\xc5\x7b\x6f\x0e\x3d\x77\x26\x6e\x1b\x27\xe6\x1a\x97\x77\xb2\x7a\xb6\x47\x9b\x11\x4c\x3b\xb2\x2c\x0a\x5d\xa5\xba\xf3\x4e\xad\xf9\x1c\xf2\x2d\xdd\x07\x5b\x2e\x7b\x85\xba\x3b\xc8\x12\x15\xd4\x0d\x5d\xb6\xac\xe1\xc1\x20\xc7\x4c\x21\xf0\xc3\xc1\xde\xa2\x5a\xe6\x3c\x6b\x78\xc9\x2b\xc5\xf3\x05\x8d\x24\x74\x97\x49\x53\x16\xcf\x72\x68\xd7\xc0\x87\x8f\x1d\x97\xe6\x8c\xd7\x26\xa8\xda\x57\x0b\xf8\x81\xea\xd5\x82\x57\xde\xec\x29\x39\xe1\xd2\xda\xf7\xe7\x4e\x87\xba\x0c\x6d\xbe\x85\x68\x68\x6d\xed\x78\x35\x51\x57\xf7\x6e\x57\xd9\x3b\x06\xb4\xda\xd5\xe4\x48\x2b\xb0\x5e\x01\x33\xcd\x97\x47\xa1\xd6\xfa\x4a\xa0\xd8\x71\x8b\x59\xc4\xdf\x9a\x83\xe4\x59\x5d\xe5\x94\x64\x72\x56\xb5\x33\x98\x5c\x64\x74\xff\x88\x34\x46\x6a\x37\x5b\xe9\xb1\x3f\x16\xa2\x92\x2b\x9a\x32\x60\xb2\x8e\xbf\x9b\x1b\xb0\x26\xfe\xc8\x6c\xcd\x4b\x76\x54\x89\x31\x12\x63\xa0\x9a\xe8\x3b\x03\xa6\xff\xdd\xa6\xbd\x28\x00\xe2\xa0\xa7\x1e\xf9\x28\x54\xb6\x26\x6e\xda\x62\x74\x46\x9b\x17\xa9\x33\xc8\x98\xe4\x9e\x56\x5e\xbb\x09\x76\xab\xeb\xfe\x08\xaa\xdf\x60\x19\xd7\xa3\x1e\xda\x93\xd7\xb2\x7e\xa6\xc8\x87\xfa\xec\xda\xf7\xb5\xdb\x52\x6b\x2f\x69\xd8\x31\x0f\xe9\xf4\x4b\xe7\x46\xb8\x47\xad\xef\x4c\xeb\xa9\x91\xe9\x21\xb7\xb3\x24\x54\xf7\x8a\x89\xc2\xbd\xb5\x31\xe2\xf7\x0c\x23\x63\xa3\xa3\x05\x4c\x2a\xbd\x9b\x0f\x5d\xaa\xf5\xf4\xeb\x6a\xbb\x1b\x90\x9d\xa5\x73\x67\x4a\xb3\xad\x3e\x57\xf5\x63\xff\x0e\x83\x56\xf1\xb7\x32\xd2\xc2\x4a\x8c\xb1\xbf\xe7\x26\xad\xe9\xdd\xa1\x58\x19\x95\x39\x06\x8e\x59\x56\x77\x23\x85\xee\xea\x68\x5c\xb8\x18\x12\xae\xe9\xe6\xbe\xed\x92\x71\xeb\xd5\xe4\xfb\x31\x2c\x95\x42\x96\x0c\xe5\xdf\x6d\x81\xcf\xe7\x90\x60\x49\x76\x2d\x7d\x61\xc8\x6e\x35\x9f\x18\xe2\xf6\x61\x5f\xc1\x7f\x82\x8f\x1e\xd7\xf2\xce\x76\x90\x89\xb4\x34\xf6\x67\x44\x26\x0d\xb4\xb7\x6e\x5a\x4c\xf8\x9a\xe4\x4f\x1b\x9e\x29\xae\x85\x02\xdf\xde\x93\x5e\x1c\x55\x9a\x51\xaf\xd6\xa8\xad\x00\xca\xf4\x3d\x57\xa3\xb3\x95\x9d\x7b\x63\x8e\xb2\x94\x5e\xab\x69\x94\x88\x33\xe0\xe4\x04\x5c\x2f\x15\xb0\xf7\x07\x46\xc2\x76\x1b\xb3\x8d\xa3\x70\xa2\xb8\x49\x14\xfa\xed\xfc\x23\x53\xa5\xd1\x58\xde\x5d\x24\xfa\x2f\x26\xbd\xde\xf6\x8e\x35\x96\x2c\xfb\xc1\x89\xbe\x7f\x7a\xa6\x72\x91\xaf\x38\x67\x60\x78\x72\xbc\x1f\x2b\x99\xbd\x5f\xfc\x0c\xa0\x97\xea\x4e\x20\xa5\xaf\x6b\x3f\xe5\x34\xa2\xe8\xcd\x0f\xfd\xfc\x8c\x52\x38\x0c\x37\x73\x19\x85\x9b\x4e\xf4\xd2\x08\x9d\x3b\x0e\x32\x89\x17\x49\x23\x3a\xbe\x4e\xcc\x25\xc6\x71\x75\x49\x36\xf1\xd2\x88\x9a\x08\x3f\x5d\xfe\x3e\x33\x86\x9d\x87\xcd\x29\xf9\x87\xc6\x88\xde\x91\x26\xee\xff\x12\xe1\xc5\x92\x7c\x6a\x78\x79\xc9\x6c\xf2\x6b\xe9\xff\x78\x68\xea\x05\xa7\x17\x0a\x4f\xc6\x1b\x61\x88\x7a\x93\x8f\xe3\x6e\x97\x78\x10\x1d\x1b\x40\x9f\x00\xc4\xe3\x01\xcc\x8b\x48\xbd\x40\xa6\xef\x34\xbb\x7f\xda\xe3\xc7\x32\x73\x35\x69\x58\xdf\xea\x6f\xf0\xf3\x73\x23\x97\x77\xdc\x5c\xec\xf2\xe7\xa9\x5f\x1a\xbc\x7a\xd3\xd9\x2f\x09\x5c\x74\x82\x61\x23\xf6\xc2\xd0\x5f\x28\x66\xb9\x44\x3a\xf7\xd5\x6d\xb1\xda\x95\xa9\x62\x35\x52\xa4\x4e\xdf\x30\x38\x52\x94\x5a\xb1\x78\xf1\xc4\x0e\x97\x26\x6f\x1a\xe0\xea\x8f\xa1\x73\xbf\xe0\xd0\x21\x53\xdb\xcb\xe0\x32\xc9\x9f\xe1\x57\x8f\xc2\x76\x24\x56\x7a\xde\x71\x02\xbb\x97\x3b\xc8\x97\x41\xed\x94\x73\x2c\x53\xe2\x6a\x3a\x2a\x7e\x0d\xe7\xe4\xba\x98\x11\xef\x44\x6d\x56\x9b\x7b\x51\xe9\xe6\x76\x56\x7b\x1d\x7b\x68\xf8\x03\x6b\x72\xed\x8f\x28\x36\x6a\x78\xe8\xcd\x47\x40\x32\x8d\x10\x72\x6d\xe7\x82\xa4\x23\x76\x06\x24\x7f\xb5\x86\x4c\xbf\x34\xb7\x8d\x6d\x03\x01\x0f\x01\x2f\xa2\xf3\xb9\x8a\x4a\xdf\x70\x71\x83\x10\xcd\x29\x71\x9d\x1b\x7f\x24\x57\x4b\x7d\x4f\xcf\x78\x28\xdc\xe0\xe4\xba\x89\x0e\xe9\x85\x1e\x9a\xcb\x1c\xeb\x80\xda\xfb\x37\xc9\xb1\xbf\x76\x3d\x71\xda\x7c\x8a\x1a\x79\x5f\x8d\x9a\xd2\x36\xb6\x98\x81\xd2\x69\xed\x4f\x5a\xec\xca\xdb\x1d\x8a\xa1\xb4\x45\x2e\x21\x56\xb5\xfe\xfb\x1b\xfd\x47\xd1\x89\x23\x77\x2d\xf3\x55\xdd\xe8\xb2\xc4\xba\xdf\x56\x47\x47\x45\x7f\x7b\x23\x7d\xd3\xf8\xf0\xb1\x4d\x35\xfb\x06\xe2\xc8\x73\xc6\x3e\x46\xa4\x7f\x99\x5c\x27\xcc\x63\x6a\x6a\x7c\xc1\x68\xab\x35\x26\x87\xe9\xfd\x95\xc8\x0f\x6e\xc6\xd8\x1f\x2d\xd3\xd4\xaa\xc3\xa5\x53\x9a\xfd\xb0\xa0\x31\xe3\xc4\xf1\x89\xf1\xe0\xe7\x8d\xc8\x66\x86\x64\x6d\x4a\x6b\x98\x10\x98\x91\x5c\x56\x3a\x19\x04\x9a\xc9\xf5\x89\x36\xdf\xce\xab\xcf\xb3\x78\xf7\x90\x3f\xd5\xe6\x0d\x50\xfa\x17\xcd\x4e\xbb\xfa\xe0\xe1\xe4\x22\xf8\x9e\xe8\x17\x06\xd7\xae\x8e\x78\x09\x23\xbe\x33\xfd\x84\xd5\xd5\x65\x9e\xa2\x3b\xf3\x2b\xf9\x8a\x09\xb5\x5d\xa8\x88\xa9\x74\xeb\xb8\x21\xcf\x41\x64\xda\x9e\x4f\xb8\x48\x71\xbe\x59\x5f\x6e\xd5\xa6\x04\x38\xd1\xaa\x7b\x95\xc6\xa9\x56\xed\x1e\xf2\x35\xac\x7a\xd4\xa2\x67\x87\xea\x7f\x3d\x53\x46\xae\xce\xa9\x08\x49\x5f\x5f\x50\x10\x3a\xe7\x8d\xd7\x83\x2f\x6a\xc0\x7f\xb2\xf1\x9e\x7a\x2d\xf2\xfc\x1a\xc9\x69\x22\x92\xb4\x90\xb7\x97\xa8\x77\x5b\x73\xfb\xb2\x9a\x17\xc9\x39\xa1\x9a\xf9\xab\xeb\xcf\xa9\x75\xfb\xb7\x9c\xbe\x56\xad\xeb\xdc\x00\x1b\x56\x3f\x54\x75\x91\xea\x2f\x2f\x73\xbb\xe0\x3a\x57\xe5\xd2\xaa\x2f\x2d\x72\xbf\x0a\x2a\x5e\x2a\x85\xb7\x29\xef\x57\xab\x70\x87\x2a\x76\x2e\x45\x75\x3f\xfe\x7f\x00\x00\x00\xff\xff\xfb\xb7\xd6\x7d\xc0\x4d\x00\x00") func templateBuilderMutationTmplBytes() ([]byte, error) { return bindataRead( @@ -201,7 +201,7 @@ func templateBuilderMutationTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template/builder/mutation.tmpl", size: 19719, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "template/builder/mutation.tmpl", size: 19904, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/entc/gen/template/builder/mutation.tmpl b/entc/gen/template/builder/mutation.tmpl index 1879e9d35..89c431fa6 100644 --- a/entc/gen/template/builder/mutation.tmpl +++ b/entc/gen/template/builder/mutation.tmpl @@ -550,23 +550,25 @@ func (m *{{ $mutation }}) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *{{ $mutation }}) AddedIDs(name string) []ent.Value { - switch name { - {{- range $e := $n.Edges }} - {{- $const := print $n.Package "." $e.Constant }} - case {{ $const }}: - {{- if $e.Unique }} - if id := m.{{ $e.BuilderField }}; id != nil { - return []ent.Value{*id} - } - {{- else }} - ids := make([]ent.Value, 0, len(m.{{ $e.BuilderField }})) - for id := range m.{{ $e.BuilderField }} { - ids = append(ids, id) - } - return ids - {{- end }} + {{- with $n.Edges }} + switch name { + {{- range $e := $n.Edges }} + {{- $const := print $n.Package "." $e.Constant }} + case {{ $const }}: + {{- if $e.Unique }} + if id := m.{{ $e.BuilderField }}; id != nil { + return []ent.Value{*id} + } + {{- else }} + ids := make([]ent.Value, 0, len(m.{{ $e.BuilderField }})) + for id := range m.{{ $e.BuilderField }} { + ids = append(ids, id) + } + return ids + {{- end }} + {{- end }} + } {{- end }} - } return nil } @@ -588,19 +590,21 @@ func (m *{{ $mutation }}) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *{{ $mutation }}) RemovedIDs(name string) []ent.Value { - switch name { - {{- range $e := $n.Edges }} - {{- if not $e.Unique }} - {{- $const := print $n.Package "." $e.Constant }} - case {{ $const }}: - ids := make([]ent.Value, 0, len(m.removed{{ $e.BuilderField }})) - for id := range m.removed{{ $e.BuilderField }} { - ids = append(ids, id) - } - return ids + {{- with $n.Edges }} + switch name { + {{- range $e := $n.Edges }} + {{- if not $e.Unique }} + {{- $const := print $n.Package "." $e.Constant }} + case {{ $const }}: + ids := make([]ent.Value, 0, len(m.removed{{ $e.BuilderField }})) + for id := range m.removed{{ $e.BuilderField }} { + ids = append(ids, id) + } + return ids + {{- end }} {{- end }} + } {{- end }} - } return nil } @@ -622,22 +626,24 @@ func (m *{{ $mutation }}) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *{{ $mutation }}) EdgeCleared(name string) bool { - switch name { - {{- range $e := $n.Edges }} - {{- if $e.Unique }} - {{- $const := print $n.Package "." $e.Constant }} - case {{ $const }}: - return m.cleared{{ $e.BuilderField }} + {{- with $n.Edges }} + switch name { + {{- range $e := $n.Edges }} + {{- if $e.Unique }} + {{- $const := print $n.Package "." $e.Constant }} + case {{ $const }}: + return m.cleared{{ $e.BuilderField }} + {{- end }} {{- end }} + } {{- end }} - } return false } // ClearEdge clears the value for the given name. It returns an // error if the edge name is not defined in the schema. func (m *{{ $mutation }}) ClearEdge(name string) error { - {{- if $n.Edges }} + {{- with $n.Edges }} switch name { {{- range $e := $n.Edges }} {{- if $e.Unique }} @@ -656,14 +662,16 @@ func (m *{{ $mutation }}) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *{{ $mutation }}) ResetEdge(name string) error { - switch name { - {{- range $e := $n.Edges }} - {{- $const := print $n.Package "." $e.Constant }} - case {{ $const }}: - m.{{ $e.MutationReset }}() - return nil + {{- with $n.Edges }} + switch name { + {{- range $e := $n.Edges }} + {{- $const := print $n.Package "." $e.Constant }} + case {{ $const }}: + m.{{ $e.MutationReset }}() + return nil + {{- end }} + } {{- end }} - } return fmt.Errorf("unknown {{ $n.Name }} edge %s", name) } {{ end }} diff --git a/entc/integration/config/ent/mutation.go b/entc/integration/config/ent/mutation.go index 4b7fcda85..0946fbb4d 100644 --- a/entc/integration/config/ent/mutation.go +++ b/entc/integration/config/ent/mutation.go @@ -209,8 +209,6 @@ func (m *UserMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *UserMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -224,8 +222,6 @@ func (m *UserMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *UserMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -239,8 +235,6 @@ func (m *UserMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *UserMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -254,7 +248,5 @@ func (m *UserMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *UserMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown User edge %s", name) } diff --git a/entc/integration/ent/mutation.go b/entc/integration/ent/mutation.go index 651817e92..5956e24d2 100644 --- a/entc/integration/ent/mutation.go +++ b/entc/integration/ent/mutation.go @@ -1126,8 +1126,6 @@ func (m *CommentMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *CommentMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -1141,8 +1139,6 @@ func (m *CommentMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *CommentMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -1156,8 +1152,6 @@ func (m *CommentMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *CommentMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -1171,8 +1165,6 @@ func (m *CommentMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *CommentMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown Comment edge %s", name) } @@ -3961,8 +3953,6 @@ func (m *FieldTypeMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *FieldTypeMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -3976,8 +3966,6 @@ func (m *FieldTypeMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *FieldTypeMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -3991,8 +3979,6 @@ func (m *FieldTypeMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *FieldTypeMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -4006,8 +3992,6 @@ func (m *FieldTypeMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *FieldTypeMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown FieldType edge %s", name) } @@ -6560,8 +6544,6 @@ func (m *ItemMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *ItemMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -6575,8 +6557,6 @@ func (m *ItemMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *ItemMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -6590,8 +6570,6 @@ func (m *ItemMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *ItemMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -6605,8 +6583,6 @@ func (m *ItemMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *ItemMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown Item edge %s", name) } diff --git a/entc/integration/gremlin/ent/mutation.go b/entc/integration/gremlin/ent/mutation.go index 6edb437af..6e1147452 100644 --- a/entc/integration/gremlin/ent/mutation.go +++ b/entc/integration/gremlin/ent/mutation.go @@ -1126,8 +1126,6 @@ func (m *CommentMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *CommentMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -1141,8 +1139,6 @@ func (m *CommentMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *CommentMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -1156,8 +1152,6 @@ func (m *CommentMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *CommentMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -1171,8 +1165,6 @@ func (m *CommentMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *CommentMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown Comment edge %s", name) } @@ -3961,8 +3953,6 @@ func (m *FieldTypeMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *FieldTypeMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -3976,8 +3966,6 @@ func (m *FieldTypeMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *FieldTypeMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -3991,8 +3979,6 @@ func (m *FieldTypeMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *FieldTypeMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -4006,8 +3992,6 @@ func (m *FieldTypeMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *FieldTypeMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown FieldType edge %s", name) } @@ -6560,8 +6544,6 @@ func (m *ItemMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *ItemMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -6575,8 +6557,6 @@ func (m *ItemMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *ItemMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -6590,8 +6570,6 @@ func (m *ItemMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *ItemMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -6605,8 +6583,6 @@ func (m *ItemMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *ItemMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown Item edge %s", name) } diff --git a/entc/integration/json/ent/mutation.go b/entc/integration/json/ent/mutation.go index 93d6009b6..f07c85166 100644 --- a/entc/integration/json/ent/mutation.go +++ b/entc/integration/json/ent/mutation.go @@ -657,8 +657,6 @@ func (m *UserMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *UserMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -672,8 +670,6 @@ func (m *UserMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *UserMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -687,8 +683,6 @@ func (m *UserMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *UserMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -702,7 +696,5 @@ func (m *UserMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *UserMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown User edge %s", name) } diff --git a/entc/integration/migrate/entv2/mutation.go b/entc/integration/migrate/entv2/mutation.go index 0f0616f5f..d86276cf5 100644 --- a/entc/integration/migrate/entv2/mutation.go +++ b/entc/integration/migrate/entv2/mutation.go @@ -509,8 +509,6 @@ func (m *GroupMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *GroupMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -524,8 +522,6 @@ func (m *GroupMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *GroupMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -539,8 +535,6 @@ func (m *GroupMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *GroupMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -554,8 +548,6 @@ func (m *GroupMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *GroupMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown Group edge %s", name) } @@ -742,8 +734,6 @@ func (m *PetMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *PetMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -757,8 +747,6 @@ func (m *PetMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *PetMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -772,8 +760,6 @@ func (m *PetMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *PetMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -787,8 +773,6 @@ func (m *PetMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *PetMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown Pet edge %s", name) } diff --git a/entc/integration/template/ent/mutation.go b/entc/integration/template/ent/mutation.go index 89939447f..0983425ad 100644 --- a/entc/integration/template/ent/mutation.go +++ b/entc/integration/template/ent/mutation.go @@ -313,8 +313,6 @@ func (m *GroupMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *GroupMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -328,8 +326,6 @@ func (m *GroupMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *GroupMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -343,8 +339,6 @@ func (m *GroupMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *GroupMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -358,8 +352,6 @@ func (m *GroupMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *GroupMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown Group edge %s", name) } diff --git a/examples/entcpkg/ent/mutation.go b/examples/entcpkg/ent/mutation.go index 4b7fcda85..0946fbb4d 100644 --- a/examples/entcpkg/ent/mutation.go +++ b/examples/entcpkg/ent/mutation.go @@ -209,8 +209,6 @@ func (m *UserMutation) AddedEdges() []string { // AddedIDs returns all ids (to other nodes) that were added for // the given edge name. func (m *UserMutation) AddedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -224,8 +222,6 @@ func (m *UserMutation) RemovedEdges() []string { // RemovedIDs returns all ids (to other nodes) that were removed for // the given edge name. func (m *UserMutation) RemovedIDs(name string) []ent.Value { - switch name { - } return nil } @@ -239,8 +235,6 @@ func (m *UserMutation) ClearedEdges() []string { // EdgeCleared returns a boolean indicates if this edge was // cleared in this mutation. func (m *UserMutation) EdgeCleared(name string) bool { - switch name { - } return false } @@ -254,7 +248,5 @@ func (m *UserMutation) ClearEdge(name string) error { // given edge name. It returns an error if the edge is not // defined in the schema. func (m *UserMutation) ResetEdge(name string) error { - switch name { - } return fmt.Errorf("unknown User edge %s", name) }