withAttestationID sets the ID field of the mutation.
(id uuid.UUID)
| 1297 | |
| 1298 | // withAttestationID sets the ID field of the mutation. |
| 1299 | func withAttestationID(id uuid.UUID) attestationOption { |
| 1300 | return func(m *AttestationMutation) { |
| 1301 | var ( |
| 1302 | err error |
| 1303 | once sync.Once |
| 1304 | value *Attestation |
| 1305 | ) |
| 1306 | m.oldValue = func(ctx context.Context) (*Attestation, error) { |
| 1307 | once.Do(func() { |
| 1308 | if m.done { |
| 1309 | err = errors.New("querying old values post mutation is not allowed") |
| 1310 | } else { |
| 1311 | value, err = m.Client().Attestation.Get(ctx, id) |
| 1312 | } |
| 1313 | }) |
| 1314 | return value, err |
| 1315 | } |
| 1316 | m.id = &id |
| 1317 | } |
| 1318 | } |
| 1319 | |
| 1320 | // withAttestation sets the old Attestation of the mutation. |
| 1321 | func withAttestation(node *Attestation) attestationOption { |
no test coverage detected