withProjectID sets the ID field of the mutation.
(id uuid.UUID)
| 10909 | |
| 10910 | // withProjectID sets the ID field of the mutation. |
| 10911 | func withProjectID(id uuid.UUID) projectOption { |
| 10912 | return func(m *ProjectMutation) { |
| 10913 | var ( |
| 10914 | err error |
| 10915 | once sync.Once |
| 10916 | value *Project |
| 10917 | ) |
| 10918 | m.oldValue = func(ctx context.Context) (*Project, error) { |
| 10919 | once.Do(func() { |
| 10920 | if m.done { |
| 10921 | err = errors.New("querying old values post mutation is not allowed") |
| 10922 | } else { |
| 10923 | value, err = m.Client().Project.Get(ctx, id) |
| 10924 | } |
| 10925 | }) |
| 10926 | return value, err |
| 10927 | } |
| 10928 | m.id = &id |
| 10929 | } |
| 10930 | } |
| 10931 | |
| 10932 | // withProject sets the old Project of the mutation. |
| 10933 | func withProject(node *Project) projectOption { |
no test coverage detected