ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
(name string)
| 14900 | // ClearField clears the value of the field with the given name. It returns an |
| 14901 | // error if the field is not defined in the schema. |
| 14902 | func (m *UserMutation) ClearField(name string) error { |
| 14903 | switch name { |
| 14904 | case user.FieldHasRestrictedAccess: |
| 14905 | m.ClearHasRestrictedAccess() |
| 14906 | return nil |
| 14907 | case user.FieldFirstName: |
| 14908 | m.ClearFirstName() |
| 14909 | return nil |
| 14910 | case user.FieldLastName: |
| 14911 | m.ClearLastName() |
| 14912 | return nil |
| 14913 | } |
| 14914 | return fmt.Errorf("unknown User nullable field %s", name) |
| 14915 | } |
| 14916 | |
| 14917 | // ResetField resets all changes in the mutation for the field with the given name. |
| 14918 | // It returns an error if the field is not defined in the schema. |