@classmethod
def walk(cls, through_document_fields=False, visited_documents=frozenset()):
    """
        Iterates recursively over the fields of the document, resolving
        occurring :class:`resolvables <.Resolvable>` to their all possible values.

        Visits fields in a DFS order.

        :param bool through_document_fields:
            If ``True``, walks through nested :class:`.DocumentField` fields.
        :param set visited_documents:
            Keeps track of visited :class:`documents <.Document>` to avoid infinite
            recursion when ``through_document_field`` is ``True``.
        :returns: iterable of :class:`.BaseField`
        """
    fields = cls._backend.walk(through_document_fields=
        through_document_fields, visited_documents=visited_documents)
    next(fields)
    return fields
