[Resolver] Extract valid_dependencies_for_target_from_node method