withGroupMembershipID sets the ID field of the mutation.
(id uuid.UUID)
| 4805 | |
| 4806 | // withGroupMembershipID sets the ID field of the mutation. |
| 4807 | func withGroupMembershipID(id uuid.UUID) groupmembershipOption { |
| 4808 | return func(m *GroupMembershipMutation) { |
| 4809 | var ( |
| 4810 | err error |
| 4811 | once sync.Once |
| 4812 | value *GroupMembership |
| 4813 | ) |
| 4814 | m.oldValue = func(ctx context.Context) (*GroupMembership, error) { |
| 4815 | once.Do(func() { |
| 4816 | if m.done { |
| 4817 | err = errors.New("querying old values post mutation is not allowed") |
| 4818 | } else { |
| 4819 | value, err = m.Client().GroupMembership.Get(ctx, id) |
| 4820 | } |
| 4821 | }) |
| 4822 | return value, err |
| 4823 | } |
| 4824 | m.id = &id |
| 4825 | } |
| 4826 | } |
| 4827 | |
| 4828 | // withGroupMembership sets the old GroupMembership of the mutation. |
| 4829 | func withGroupMembership(node *GroupMembership) groupmembershipOption { |
no test coverage detected