withGroupID sets the ID field of the mutation.
(id uuid.UUID)
| 3937 | |
| 3938 | // withGroupID sets the ID field of the mutation. |
| 3939 | func withGroupID(id uuid.UUID) groupOption { |
| 3940 | return func(m *GroupMutation) { |
| 3941 | var ( |
| 3942 | err error |
| 3943 | once sync.Once |
| 3944 | value *Group |
| 3945 | ) |
| 3946 | m.oldValue = func(ctx context.Context) (*Group, error) { |
| 3947 | once.Do(func() { |
| 3948 | if m.done { |
| 3949 | err = errors.New("querying old values post mutation is not allowed") |
| 3950 | } else { |
| 3951 | value, err = m.Client().Group.Get(ctx, id) |
| 3952 | } |
| 3953 | }) |
| 3954 | return value, err |
| 3955 | } |
| 3956 | m.id = &id |
| 3957 | } |
| 3958 | } |
| 3959 | |
| 3960 | // withGroup sets the old Group of the mutation. |
| 3961 | func withGroup(node *Group) groupOption { |
no test coverage detected