8 – How render view with programmatically passed parameters of contextual filter


Use hook_views_pre_view

function mymodule_views_pre_view(DrupalviewsViewExecutable $view, $display_id, array &$args) {
  // Modify contextual filters for view_name.
  $paragraph_id = 22;
  if ($view->id() == 'view_name') {
    $args = ($paragraph_id); // args must be an array.
  }
}