Add a query method.