isA reports whether an object of type concrete is also of type name, which can be the same type, an interface it implements or a union it belongs to.
(schema *ast.Schema, concrete *ast.Definition, name string)
| 298 | // isA reports whether an object of type concrete is also of type name, which |
| 299 | // can be the same type, an interface it implements or a union it belongs to. |
| 300 | func isA(schema *ast.Schema, concrete *ast.Definition, name string) bool { |
| 301 | if concrete.Name == name { |
| 302 | return true |
| 303 | } |
| 304 | def := schema.Types[name] |
| 305 | if def == nil { |
| 306 | return false |
| 307 | } |
| 308 | for _, t := range schema.GetPossibleTypes(def) { |
| 309 | if t.Name == concrete.Name { |
| 310 | return true |
| 311 | } |
| 312 | } |
| 313 | return false |
| 314 | } |
| 315 | |
| 316 | func (w *gqlWalker) checkObject(path string, obj map[string]any, def *ast.Definition, sel ast.SelectionSet, required bool) { |
| 317 | concrete := def |