#1. select * from table id = "" { human(id:"1002"){ id name friends { id } appearsIn } } #2. select * from table t1 left join table t2 on t1.id = t2.friends_id { human(id:"1002"){ id name friends { id name } appearsIn } } #3. 别名的使用 { h1:human(id:"1002"){ id name homePlanet } h2:human(id:"1003"){ id name homePlanet } } #4. 字段的复用 { h1:human(id:"1002"){ ...hf } h2:human(id:"1003"){ ...hf } } fragment hf on Human{ id name homePlanet } #5. 获取接口特有数据 { hero(episode:EMPIRE){ id name friends { id } appearsIn ...on Droid{ primaryFunction } ...on Human{ homePlanet } } } # 给查询定义名称 query q1 { hero(episode:EMPIRE){ id name friends { id } appearsIn ...on Droid{ primaryFunction } ...on Human{ homePlanet } } } # 动态传递参数 query queryC($id:Episode){ hero(episode:$id){ name appearsIn } } {"episode":"JEDI"} #传递进去的参数