@@ 132,7 132,15 @@ func (s *Service) GQLPlayground(c echo.Context) error {
op := gqlclient.NewOperation(form.Query)
err := s.execute(c.Request().Context(), op, &result)
if err != nil {
- if graphError, ok := err.(*gqlclient.Error); ok {
+ switch err.(type) {
+ case *gqlclient.HTTPError:
+ graphError := err.(*gqlclient.HTTPError)
+ inputErrs := validate.NewInputErrors()
+ inputErrs["_global_"] = []string{graphError.Error()}
+ gmap["errors"] = inputErrs
+ return s.Render(c, http.StatusOK, "graphql.html", gmap)
+ case *gqlclient.Error:
+ graphError := err.(*gqlclient.Error)
gmap["form"] = form
err = s.parse(c, graphError, gobwebs.Map{})
switch err.(type) {