这个查询方法,学习过还没有在开发中真正的使用过。感觉没有上述的三种好用。
例子:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Graphic</title>
    <link rel="stylesheet" href="https://js.arcgis.com/3.28/esri/css/esri.css"/>
    <link rel="stylesheet" href="https://js.arcgis.com/3.28/dijit/themes/tundra/tundra.css"/>
    <script  type="text/Javascript" src="https://js.arcgis.com/3.28/"></script>
    <style>
        .MapClass{
            width:100%;
            height:800px;
            border:1px solid #000;
        }
    </style>
    <script>
        require(["esri/map","esri/layers/ArcGISDynamicMapServiceLayer",
            "esri/layers/GraphicsLayer",
            "dojo/on","dojo/query","dojo/colors",
            "esri/graphic","esri/symbols/SimpleMarkerSymbol",
            "esri/symbols/SimpleLineSymbol",
            "esri/geometry/Point",
                    "dojo/domReady!"],
                function(Map,ArcGISDynamicMapServiceLayer,
                         GraphicsLayer,on,query,Color,Graphic,
                         SimpleMarkerSymbol,SimpleLineSymbol,Point){
            var map = new Map("mapDiv");
            var layer = new ArcGISDynamicMapServiceLayer
            ("http://localhost:6080/arcgis/rest/services/ecology/beijing_2012_3/MapServer");
            map.addLayer(layer);
            //创建客户端图层
            var graphicsLayer=new GraphicsLayer();
            //将客户端图层添加到地图中
            map.addLayer(graphicsLayer);
            //添加点图形的函数
            function addGraphic()
            {
                var lineSymbol=new SimpleLineSymbol(SimpleLineSymbol.STYLE_DASH, new Color([255, 0, 0]), 3);
                var pSymbol=new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE,10, lineSymbol, new Color([255, 0, 0]));
                var geometry;
                var graphic;
                //添加第一个点
                geometry=new Point({
                    "x":510706,
                    "y":3986100,
                    "spatialReference":map.spatialReference,
                    attributes:{
                        "h":100,
                    }
                });
                graphic=new Graphic(geometry,pSymbol);
                graphicsLayer.add(graphic);
                //添加第二个点图形
                geometry=new Point({
                    "x":510326,
                    "y":3985702,
                    "spatialReference":map.spatialReference,
                    attributes:{
                        "h":200,
                    }
                });
                graphic=new Graphic(geometry,pSymbol);
                graphicsLayer.add(graphic);
                //添加第三个点
                geometry=new Point({
                    "x":510275,
                    "y":3986100,
                    "spatialReference":map.spatialReference,
                    attributes:{
                        "h":300,
                    }
                });
                graphic=new Graphic(geometry,pSymbol);
                graphicsLayer.add(graphic);
            }
            addGraphic();
            //绑定事件
            on(graphicsLayer,"click",function(event){
                var graphic=event.graphic;
                alert(graphic.attributes["h"]);
            })


        })
    </script>
</head>
<body>
    <div id="mapDiv" class="MapClass"></div>
</body>
</html>