def traverse()

in connectors/sources/graphql.py [0:0]


        def traverse(selections, path):
            for selection in selections:
                if selection.name.value == path[0]:
                    if len(path) == 1:
                        if check_id and selection.selection_set:
                            for selection_node in selection.selection_set.selections:
                                if selection_node.name.value == graphql_field_id:
                                    return True, True
                        return True, False
                    if selection.selection_set:
                        return traverse(
                            selections=selection.selection_set.selections, path=path[1:]
                        )
            return False, False