withIntegrationID sets the ID field of the mutation.
(id uuid.UUID)
| 5533 | |
| 5534 | // withIntegrationID sets the ID field of the mutation. |
| 5535 | func withIntegrationID(id uuid.UUID) integrationOption { |
| 5536 | return func(m *IntegrationMutation) { |
| 5537 | var ( |
| 5538 | err error |
| 5539 | once sync.Once |
| 5540 | value *Integration |
| 5541 | ) |
| 5542 | m.oldValue = func(ctx context.Context) (*Integration, error) { |
| 5543 | once.Do(func() { |
| 5544 | if m.done { |
| 5545 | err = errors.New("querying old values post mutation is not allowed") |
| 5546 | } else { |
| 5547 | value, err = m.Client().Integration.Get(ctx, id) |
| 5548 | } |
| 5549 | }) |
| 5550 | return value, err |
| 5551 | } |
| 5552 | m.id = &id |
| 5553 | } |
| 5554 | } |
| 5555 | |
| 5556 | // withIntegration sets the old Integration of the mutation. |
| 5557 | func withIntegration(node *Integration) integrationOption { |
no test coverage detected