query method receives an object