Pass results of custom query to loop – when writing a plugin

Found the correct hook to use. This intercepts the query and lets me modify it for my own purposes:

add_filter('posts_request', 'changeQuery');

function changeQuery($query) {
  $query = 'my new sql query here';
  return $query;
}