MCPcopy Create free account
hub / github.com/dagger/dagger / is_self_chainable

Function is_self_chainable

sdk/python/codegen/src/codegen/generator.py:342–351  ·  view source on GitHub ↗

Checks if an object type has any fields that return that same type.

(t: GraphQLObjectType)

Source from the content-addressed store, hash-verified

340
341
342def 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
354def is_id_type(

Callers 1

render_bodyMethod · 0.85

Calls 3

is_required_typeFunction · 0.85
is_object_typeFunction · 0.85
valuesMethod · 0.45

Tested by

no test coverage detected