withCASMappingID sets the ID field of the mutation.
(id uuid.UUID)
| 3186 | |
| 3187 | // withCASMappingID sets the ID field of the mutation. |
| 3188 | func withCASMappingID(id uuid.UUID) casmappingOption { |
| 3189 | return func(m *CASMappingMutation) { |
| 3190 | var ( |
| 3191 | err error |
| 3192 | once sync.Once |
| 3193 | value *CASMapping |
| 3194 | ) |
| 3195 | m.oldValue = func(ctx context.Context) (*CASMapping, error) { |
| 3196 | once.Do(func() { |
| 3197 | if m.done { |
| 3198 | err = errors.New("querying old values post mutation is not allowed") |
| 3199 | } else { |
| 3200 | value, err = m.Client().CASMapping.Get(ctx, id) |
| 3201 | } |
| 3202 | }) |
| 3203 | return value, err |
| 3204 | } |
| 3205 | m.id = &id |
| 3206 | } |
| 3207 | } |
| 3208 | |
| 3209 | // withCASMapping sets the old CASMapping of the mutation. |
| 3210 | func withCASMapping(node *CASMapping) casmappingOption { |
no test coverage detected