extract query object