Return a function that specifies the interfaces implemented by the given type.

def _create_interface_specification(schema_graph, graphql_types, hidden_classes, cls_name):
    """Return a function that specifies the interfaces implemented by the given type."""
    def interface_spec():
        """Return a list of GraphQL interface types implemented by the type named 'cls_name'."""
        abstract_inheritance_set = (
            superclass_name
            for superclass_name in sorted(list(schema_graph.get_inheritance_set(cls_name)))
            if (superclass_name not in hidden_classes and
                schema_graph.get_element_by_class_name(superclass_name).abstract)
        )

        return [
            graphql_types[x]
            for x in abstract_inheritance_set
            if x not in hidden_classes
        ]

    return interface_spec