Revert "pass the query as a string using to_query so it plays nicely with pact"

This reverts commit 31422243ae1ddb682fde7d5f8df8a750ccdbad41.
Attempt two at fixing issue with pact and query string