diff --git a/internal/validation/validation.go b/internal/validation/validation.go index ad11c519420..f978d17473e 100644 --- a/internal/validation/validation.go +++ b/internal/validation/validation.go @@ -607,6 +607,9 @@ func validateBasicLit(v *common.BasicLit, t common.Type) bool { return v.Type == scanner.Ident && (v.Text == "true" || v.Text == "false") case "ID": return v.Type == scanner.Int || v.Type == scanner.String + default: + //TODO: Type-check against expected type by Unmarshalling + return true } case *schema.Enum: diff --git a/time.go b/time.go index da8ec9a5c07..05c616d0fcb 100644 --- a/time.go +++ b/time.go @@ -27,6 +27,9 @@ func (t *Time) UnmarshalGraphQL(input interface{}) error { case int: t.Time = time.Unix(int64(input), 0) return nil + case float64: + t.Time = time.Unix(int64(input), 0) + return nil default: return fmt.Errorf("wrong type") }