Checks if an object type has any fields that return that same type.
(t: GraphQLObjectType)
| 340 | |
| 341 | |
| 342 | def is_self_chainable(t: GraphQLObjectType) -> bool: |
| 343 | """Checks if an object type has any fields that return that same type.""" |
| 344 | return any( |
| 345 | f |
| 346 | for f in t.fields.values() |
| 347 | # Only consider fields that return a non-null object. |
| 348 | if is_required_type(f.type) |
| 349 | and is_object_type(f.type.of_type) |
| 350 | and f.type.of_type.name == t.name |
| 351 | ) |
| 352 | |
| 353 | |
| 354 | def is_id_type( |
no test coverage detected