def _sort_types(self, types: list[GraphQLType]) -> list[GraphQLType]:
        """Sort the types.

        t1 < t2 iff t2 has a dependency on t1.
        t1 == t2 iff neither type has a dependency on the other.
        """

        def type_cmp(t1: GraphQLType, t2: GraphQLType) -> int:
            """Compare the types."""
            if t1 is t2:
                retval = 0
            elif t1 in _get_deps(t2):
                retval = -1
            elif t2 in _get_deps(t1):
                retval = 1
            else:
                retval = 0

            return retval

        return sorted(types, key=cmp_to_key(type_cmp))
Sort the types.

        t1 < t2 iff t2 has a dependency on t1.
        t1 == t2 iff neither type has a dependency on the other.
        
strawberry/codegen/query_codegen.py