Views query alter in Drupal 8

hook_views_query_alter(ViewExecutable $view, QueryPluginBase $query)

You must implement this hook inside my_module.views_execution.inc. It won't work inside my_module.module file.

- vladm

reference: https://api.drupal.org/comment/61807#comment-61807