从graphql查询中排除meta(__ type,symbol)信息

时间:2018-07-16 16:15:39

标签: graphql

使用Graphql查询时,出现以下查询。

{  
   "data":{  
      "type":"FeatureCollection",
      "features":[  
         {  
            "type":"Feature",
            "geometry":{  
               "type":"Point",
               "coordinates":[  
                  38.544907,
                  -121.740517
               ],
               "__typename":"GeometryType"
            },
            "__typename":"MapInfoType"
         }
      ]
   },
   "type":"geojson"
}

GraphQL中是否可以直接不使用外部函数来排除所有元信息?

我想直接从GraphQL获得什么:

{  
   "data":{  
      "type":"FeatureCollection",
      "features":[  
         {  
            "type":"Feature",
            "geometry":{  
               "type":"Point",
               "coordinates":[  
                  38.544907,
                  -121.740517
               ],
            },
         }
      ]
   },
   "type":"geojson"
}

和查询

从“ graphql-tag”导入gql;

export default gql`
    {
        geoSites {

            mapInfo {
                type
                geometry {
                    type
                    coordinates
                }

            }
        }
    }
`;

0 个答案:

没有答案