Flip the arguments of query because they are more useful in general