withOrganizationID sets the ID field of the mutation.
(id uuid.UUID)
| 9087 | |
| 9088 | // withOrganizationID sets the ID field of the mutation. |
| 9089 | func withOrganizationID(id uuid.UUID) organizationOption { |
| 9090 | return func(m *OrganizationMutation) { |
| 9091 | var ( |
| 9092 | err error |
| 9093 | once sync.Once |
| 9094 | value *Organization |
| 9095 | ) |
| 9096 | m.oldValue = func(ctx context.Context) (*Organization, error) { |
| 9097 | once.Do(func() { |
| 9098 | if m.done { |
| 9099 | err = errors.New("querying old values post mutation is not allowed") |
| 9100 | } else { |
| 9101 | value, err = m.Client().Organization.Get(ctx, id) |
| 9102 | } |
| 9103 | }) |
| 9104 | return value, err |
| 9105 | } |
| 9106 | m.id = &id |
| 9107 | } |
| 9108 | } |
| 9109 | |
| 9110 | // withOrganization sets the old Organization of the mutation. |
| 9111 | func withOrganization(node *Organization) organizationOption { |
no test coverage detected