schema/edge: allow setting immutable edges (#2876)

This commit is contained in:
Ariel Mashraki
2022-08-20 19:10:16 +03:00
committed by GitHub
parent 461ab4a3e4
commit b18ca9ca6f
44 changed files with 107 additions and 889 deletions

View File

@@ -127,6 +127,10 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }}
{{- end }}
{{- end }}
{{- range $e := $.EdgesWithID }}
{{- if $e.Immutable }}
{{- /* Skip to the next one as immutable edges cannot be updated. */}}
{{- continue }}
{{- end }}
if {{ $mutation }}.{{ $e.MutationCleared }}() {
{{- with extend $ "Edge" $e }}
{{ template "dialect/sql/defedge" . }}