throw an InvalidArgumentException when querying with invalid conditions