Test the return object is Query