Deprecated toQuery