(v any)
| 194 | } |
| 195 | |
| 196 | func (w *gqlWalker) checkErrors(v any) { |
| 197 | list, ok := v.([]any) |
| 198 | if !ok { |
| 199 | w.addf("errors", "should be a list, but is %s", describeJSON(v)) |
| 200 | return |
| 201 | } |
| 202 | if len(list) == 0 { |
| 203 | w.addf("errors", "must contain at least one error") |
| 204 | } |
| 205 | for i, item := range list { |
| 206 | path := fmt.Sprintf("errors.%d", i) |
| 207 | obj, ok := item.(map[string]any) |
| 208 | if !ok { |
| 209 | w.addf(path, "should be an object, but is %s", describeJSON(item)) |
| 210 | continue |
| 211 | } |
| 212 | if _, ok := obj["message"].(string); !ok { |
| 213 | w.addf(path+".message", "should be a string, but is %s", describeJSON(obj["message"])) |
| 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | // selected is a field the query asked for. Fields in fragments or directives |
| 219 | // that might not apply aren't required. Fields in |
no test coverage detected