Enhanced query resolver