add test for query patch