|
|
@ -1,6 +1,7 @@ |
|
|
|
package models |
|
|
|
|
|
|
|
import ( |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"io" |
|
|
|
) |
|
|
@ -35,15 +36,14 @@ func (e *StoryCategory) IsValid() bool { |
|
|
|
func (e *StoryCategory) UnmarshalGQL(v interface{}) error { |
|
|
|
str, ok := v.(string) |
|
|
|
if !ok { |
|
|
|
return fmt.Errorf("enums must be strings") |
|
|
|
return errors.New("enums must be strings") |
|
|
|
} |
|
|
|
|
|
|
|
*e = StoryCategory(str) |
|
|
|
if !e.IsValid() { |
|
|
|
return fmt.Errorf("%s is not a valid StoryCategory", str) |
|
|
|
return fmt.Errorf("\"%s\" is not a valid StoryCategory", str) |
|
|
|
} |
|
|
|
|
|
|
|
*e = StoryCategory(str) |
|
|
|
|
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|