-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_index.json
1 lines (1 loc) · 35.1 KB
/
search_index.json
1
{"index":{"version":"0.5.12","fields":[{"name":"title","boost":10},{"name":"keywords","boost":15},{"name":"body","boost":1}],"ref":"url","documentStore":{"store":{"./":["\"luke","\"me\":","\"name\":","function","graphql","graphql介绍","graphql是一种支持api的查询语言,同时也是根据你的数据自定义类型(type)系统的服务端热执行查询。graphql并没有绑定任何数据库或内存引擎,而是完全基于你现有的代码和数据。","id","id:","me:","name","name:","queri","query_me(request)","request.auth.user;","return","skywalker\"","string","type","user","user.getname();","user_name(user)","{","}","一个graphql服务是通过定义类型(type)和type上的fields,","介绍","在这一系列的文章中我们将学习graphql是怎样工作的。想要通过文档知道如何打造graphql服务?这里有一些库可以帮助你在很多不同语言里实现graphql。","学习更多关于graphql","对应每一个type里的field的函数:","当一个graphql服务正在运行时(通常在一个web服务的url上),可以通过发送graphql语句来进行验证和执行。一个收到的查询语句会首先被检查以保证它被指向被定义的types和fields,然后运行提供的函数来执行结果。","查询语句,类型系统,graphql服务如何工作,以及用graphql来解决一般问题的最佳实践","比如这个语句:","然后给每一个type里的fields提供函数来创建的。比如,一个graphql服务要告诉我们谁是已登陆的用户(我自己)以及用户的名字可能会是这样的:","能够生成以下json结果:","这些就是这个部分所写的内容。"],"chapter1.html":["\"data\":","\"friends\":","\"han","\"hero\":","\"leia","\"luke","\"name\":","\"r2","#","[","]","appearsin","comments!","d2\"","d2\",","d2”。","field","fields,让客户端能够在一次请求中获取到多个相关数据,而不是像传统的rest架构里需要反复请求多次。","friend","hero","mutations)","name","organa\"","queri","selection。graphql语句能遍历相关联的对象和它们的","skywalker\"","solo\"","string","sub","{","}","},","上面的语句是交互性(interactive)的。言下之意你可以按照你的喜好来获取新的结果。试着在查询语句里添加一个","也能指向对象。在这种情况里,你能给那个对象创建一个","你可以立即看见查询结果有完全一样的数据结构。这对于graphql来说是很有必要的,因为你总是得到你所想要的,而且服务器准确的知道客户端要求的fields是什么。","到","在之前的例子里,我们只是查询英雄的名字对应","在这一页里,你将会了解到如何在一个graphql服务器上查询。","在这个例子中可以看到,friend","对了,还有一件事","对象里,然后看新的结果","最简单来说,graphql就是关于询问对象里特定的fields。让我们从看一个非常简单的语句和运行之后获得的结果开始:","查询语句和转变","查询语句和转变(queri","的","的回馈,但是","类型,在这个情况下是星际争霸主角英雄的名字“r2","返回一个","返回了一组数据单元。对于graphql语句来说,单数据元还是一个列表的数据元都是一样的,但是基于表达的数据模式我们知道最后会获得的是哪一个。"]},"length":2},"tokenStore":{"root":{"docs":{},"\"":{"docs":{},"l":{"docs":{},"u":{"docs":{},"k":{"docs":{},"e":{"docs":{"./":{"ref":"./","tf":0.0196078431372549},"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}},"e":{"docs":{},"i":{"docs":{},"a":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}},"m":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"\"":{"docs":{},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549},"chapter1.html":{"ref":"chapter1.html","tf":0.054945054945054944}}}}}}}},"d":{"docs":{},"a":{"docs":{},"t":{"docs":{},"a":{"docs":{},"\"":{"docs":{},":":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.02197802197802198}}}}}}}},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{},"s":{"docs":{},"\"":{"docs":{},":":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}},"h":{"docs":{},"a":{"docs":{},"n":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{},"\"":{"docs":{},":":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.02197802197802198}}}}}}}},"r":{"2":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.02197802197802198}}},"docs":{}}},"f":{"docs":{},"u":{"docs":{},"n":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{"./":{"ref":"./","tf":0.0392156862745098}}}}}}}}},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.06593406593406594}},"s":{"docs":{},",":{"docs":{},"让":{"docs":{},"客":{"docs":{},"户":{"docs":{},"端":{"docs":{},"能":{"docs":{},"够":{"docs":{},"在":{"docs":{},"一":{"docs":{},"次":{"docs":{},"请":{"docs":{},"求":{"docs":{},"中":{"docs":{},"获":{"docs":{},"取":{"docs":{},"到":{"docs":{},"多":{"docs":{},"个":{"docs":{},"相":{"docs":{},"关":{"docs":{},"数":{"docs":{},"据":{"docs":{},",":{"docs":{},"而":{"docs":{},"不":{"docs":{},"是":{"docs":{},"像":{"docs":{},"传":{"docs":{},"统":{"docs":{},"的":{"docs":{},"r":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},"架":{"docs":{},"构":{"docs":{},"里":{"docs":{},"需":{"docs":{},"要":{"docs":{},"反":{"docs":{},"复":{"docs":{},"请":{"docs":{},"求":{"docs":{},"多":{"docs":{},"次":{"docs":{},"。":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{"./":{"ref":"./","tf":5}},"介":{"docs":{},"绍":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}},"是":{"docs":{},"一":{"docs":{},"种":{"docs":{},"支":{"docs":{},"持":{"docs":{},"a":{"docs":{},"p":{"docs":{},"i":{"docs":{},"的":{"docs":{},"查":{"docs":{},"询":{"docs":{},"语":{"docs":{},"言":{"docs":{},",":{"docs":{},"同":{"docs":{},"时":{"docs":{},"也":{"docs":{},"是":{"docs":{},"根":{"docs":{},"据":{"docs":{},"你":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"自":{"docs":{},"定":{"docs":{},"义":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},")":{"docs":{},"系":{"docs":{},"统":{"docs":{},"的":{"docs":{},"服":{"docs":{},"务":{"docs":{},"端":{"docs":{},"热":{"docs":{},"执":{"docs":{},"行":{"docs":{},"查":{"docs":{},"询":{"docs":{},"。":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"并":{"docs":{},"没":{"docs":{},"有":{"docs":{},"绑":{"docs":{},"定":{"docs":{},"任":{"docs":{},"何":{"docs":{},"数":{"docs":{},"据":{"docs":{},"库":{"docs":{},"或":{"docs":{},"内":{"docs":{},"存":{"docs":{},"引":{"docs":{},"擎":{"docs":{},",":{"docs":{},"而":{"docs":{},"是":{"docs":{},"完":{"docs":{},"全":{"docs":{},"基":{"docs":{},"于":{"docs":{},"你":{"docs":{},"现":{"docs":{},"有":{"docs":{},"的":{"docs":{},"代":{"docs":{},"码":{"docs":{},"和":{"docs":{},"数":{"docs":{},"据":{"docs":{},"。":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"i":{"docs":{},"d":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}},"m":{"docs":{},"e":{"docs":{},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}},"u":{"docs":{},"t":{"docs":{},"a":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"s":{"docs":{},")":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{"./":{"ref":"./","tf":0.0196078431372549},"chapter1.html":{"ref":"chapter1.html","tf":0.04395604395604396}},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"./":{"ref":"./","tf":0.0196078431372549},"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}},"y":{"docs":{},"_":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},")":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}},"r":{"docs":{},"e":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"s":{"docs":{},"t":{"docs":{},".":{"docs":{},"a":{"docs":{},"u":{"docs":{},"t":{"docs":{},"h":{"docs":{},".":{"docs":{},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},";":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}},"t":{"docs":{},"u":{"docs":{},"r":{"docs":{},"n":{"docs":{"./":{"ref":"./","tf":0.0392156862745098}}}}}}}},"s":{"docs":{},"k":{"docs":{},"y":{"docs":{},"w":{"docs":{},"a":{"docs":{},"l":{"docs":{},"k":{"docs":{},"e":{"docs":{},"r":{"docs":{},"\"":{"docs":{"./":{"ref":"./","tf":0.0196078431372549},"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}},"t":{"docs":{},"r":{"docs":{},"i":{"docs":{},"n":{"docs":{},"g":{"docs":{"./":{"ref":"./","tf":0.0196078431372549},"chapter1.html":{"ref":"chapter1.html","tf":0.02197802197802198}}}}}}},"e":{"docs":{},"l":{"docs":{},"e":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"o":{"docs":{},"n":{"docs":{},"。":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"语":{"docs":{},"句":{"docs":{},"能":{"docs":{},"遍":{"docs":{},"历":{"docs":{},"相":{"docs":{},"关":{"docs":{},"联":{"docs":{},"的":{"docs":{},"对":{"docs":{},"象":{"docs":{},"和":{"docs":{},"它":{"docs":{},"们":{"docs":{},"的":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"o":{"docs":{},"l":{"docs":{},"o":{"docs":{},"\"":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}},"u":{"docs":{},"b":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{"./":{"ref":"./","tf":0.0392156862745098}}}}}},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{"./":{"ref":"./","tf":0.0392156862745098}},".":{"docs":{},"g":{"docs":{},"e":{"docs":{},"t":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},")":{"docs":{},";":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}},"_":{"docs":{},"n":{"docs":{},"a":{"docs":{},"m":{"docs":{},"e":{"docs":{},"(":{"docs":{},"u":{"docs":{},"s":{"docs":{},"e":{"docs":{},"r":{"docs":{},")":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}},"{":{"docs":{"./":{"ref":"./","tf":0.1568627450980392},"chapter1.html":{"ref":"chapter1.html","tf":0.15384615384615385}}},"}":{"docs":{"./":{"ref":"./","tf":0.1568627450980392},"chapter1.html":{"ref":"chapter1.html","tf":0.13186813186813187}},",":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.02197802197802198}}}},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"服":{"docs":{},"务":{"docs":{},"是":{"docs":{},"通":{"docs":{},"过":{"docs":{},"定":{"docs":{},"义":{"docs":{},"类":{"docs":{},"型":{"docs":{},"(":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},")":{"docs":{},"和":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"上":{"docs":{},"的":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"s":{"docs":{},",":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"介":{"docs":{},"绍":{"docs":{"./":{"ref":"./","tf":5}}}},"在":{"docs":{},"这":{"docs":{},"一":{"docs":{},"系":{"docs":{},"列":{"docs":{},"的":{"docs":{},"文":{"docs":{},"章":{"docs":{},"中":{"docs":{},"我":{"docs":{},"们":{"docs":{},"将":{"docs":{},"学":{"docs":{},"习":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"是":{"docs":{},"怎":{"docs":{},"样":{"docs":{},"工":{"docs":{},"作":{"docs":{},"的":{"docs":{},"。":{"docs":{},"想":{"docs":{},"要":{"docs":{},"通":{"docs":{},"过":{"docs":{},"文":{"docs":{},"档":{"docs":{},"知":{"docs":{},"道":{"docs":{},"如":{"docs":{},"何":{"docs":{},"打":{"docs":{},"造":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"服":{"docs":{},"务":{"docs":{},"?":{"docs":{},"这":{"docs":{},"里":{"docs":{},"有":{"docs":{},"一":{"docs":{},"些":{"docs":{},"库":{"docs":{},"可":{"docs":{},"以":{"docs":{},"帮":{"docs":{},"助":{"docs":{},"你":{"docs":{},"在":{"docs":{},"很":{"docs":{},"多":{"docs":{},"不":{"docs":{},"同":{"docs":{},"语":{"docs":{},"言":{"docs":{},"里":{"docs":{},"实":{"docs":{},"现":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"。":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"页":{"docs":{},"里":{"docs":{},",":{"docs":{},"你":{"docs":{},"将":{"docs":{},"会":{"docs":{},"了":{"docs":{},"解":{"docs":{},"到":{"docs":{},"如":{"docs":{},"何":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"服":{"docs":{},"务":{"docs":{},"器":{"docs":{},"上":{"docs":{},"查":{"docs":{},"询":{"docs":{},"。":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"个":{"docs":{},"例":{"docs":{},"子":{"docs":{},"中":{"docs":{},"可":{"docs":{},"以":{"docs":{},"看":{"docs":{},"到":{"docs":{},",":{"docs":{},"f":{"docs":{},"r":{"docs":{},"i":{"docs":{},"e":{"docs":{},"n":{"docs":{},"d":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}},"之":{"docs":{},"前":{"docs":{},"的":{"docs":{},"例":{"docs":{},"子":{"docs":{},"里":{"docs":{},",":{"docs":{},"我":{"docs":{},"们":{"docs":{},"只":{"docs":{},"是":{"docs":{},"查":{"docs":{},"询":{"docs":{},"英":{"docs":{},"雄":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"对":{"docs":{},"应":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}},"学":{"docs":{},"习":{"docs":{},"更":{"docs":{},"多":{"docs":{},"关":{"docs":{},"于":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}},"对":{"docs":{},"应":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"里":{"docs":{},"的":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}}}},"了":{"docs":{},",":{"docs":{},"还":{"docs":{},"有":{"docs":{},"一":{"docs":{},"件":{"docs":{},"事":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}},"象":{"docs":{},"里":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"看":{"docs":{},"新":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}},"当":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"服":{"docs":{},"务":{"docs":{},"正":{"docs":{},"在":{"docs":{},"运":{"docs":{},"行":{"docs":{},"时":{"docs":{},"(":{"docs":{},"通":{"docs":{},"常":{"docs":{},"在":{"docs":{},"一":{"docs":{},"个":{"docs":{},"w":{"docs":{},"e":{"docs":{},"b":{"docs":{},"服":{"docs":{},"务":{"docs":{},"的":{"docs":{},"u":{"docs":{},"r":{"docs":{},"l":{"docs":{},"上":{"docs":{},")":{"docs":{},",":{"docs":{},"可":{"docs":{},"以":{"docs":{},"通":{"docs":{},"过":{"docs":{},"发":{"docs":{},"送":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"语":{"docs":{},"句":{"docs":{},"来":{"docs":{},"进":{"docs":{},"行":{"docs":{},"验":{"docs":{},"证":{"docs":{},"和":{"docs":{},"执":{"docs":{},"行":{"docs":{},"。":{"docs":{},"一":{"docs":{},"个":{"docs":{},"收":{"docs":{},"到":{"docs":{},"的":{"docs":{},"查":{"docs":{},"询":{"docs":{},"语":{"docs":{},"句":{"docs":{},"会":{"docs":{},"首":{"docs":{},"先":{"docs":{},"被":{"docs":{},"检":{"docs":{},"查":{"docs":{},"以":{"docs":{},"保":{"docs":{},"证":{"docs":{},"它":{"docs":{},"被":{"docs":{},"指":{"docs":{},"向":{"docs":{},"被":{"docs":{},"定":{"docs":{},"义":{"docs":{},"的":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"s":{"docs":{},"和":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"s":{"docs":{},",":{"docs":{},"然":{"docs":{},"后":{"docs":{},"运":{"docs":{},"行":{"docs":{},"提":{"docs":{},"供":{"docs":{},"的":{"docs":{},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"执":{"docs":{},"行":{"docs":{},"结":{"docs":{},"果":{"docs":{},"。":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"查":{"docs":{},"询":{"docs":{},"语":{"docs":{},"句":{"docs":{},",":{"docs":{},"类":{"docs":{},"型":{"docs":{},"系":{"docs":{},"统":{"docs":{},",":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"服":{"docs":{},"务":{"docs":{},"如":{"docs":{},"何":{"docs":{},"工":{"docs":{},"作":{"docs":{},",":{"docs":{},"以":{"docs":{},"及":{"docs":{},"用":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"来":{"docs":{},"解":{"docs":{},"决":{"docs":{},"一":{"docs":{},"般":{"docs":{},"问":{"docs":{},"题":{"docs":{},"的":{"docs":{},"最":{"docs":{},"佳":{"docs":{},"实":{"docs":{},"践":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"和":{"docs":{},"转":{"docs":{},"变":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":10}},"(":{"docs":{},"q":{"docs":{},"u":{"docs":{},"e":{"docs":{},"r":{"docs":{},"i":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}},"比":{"docs":{},"如":{"docs":{},"这":{"docs":{},"个":{"docs":{},"语":{"docs":{},"句":{"docs":{},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}},"然":{"docs":{},"后":{"docs":{},"给":{"docs":{},"每":{"docs":{},"一":{"docs":{},"个":{"docs":{},"t":{"docs":{},"y":{"docs":{},"p":{"docs":{},"e":{"docs":{},"里":{"docs":{},"的":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"s":{"docs":{},"提":{"docs":{},"供":{"docs":{},"函":{"docs":{},"数":{"docs":{},"来":{"docs":{},"创":{"docs":{},"建":{"docs":{},"的":{"docs":{},"。":{"docs":{},"比":{"docs":{},"如":{"docs":{},",":{"docs":{},"一":{"docs":{},"个":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"服":{"docs":{},"务":{"docs":{},"要":{"docs":{},"告":{"docs":{},"诉":{"docs":{},"我":{"docs":{},"们":{"docs":{},"谁":{"docs":{},"是":{"docs":{},"已":{"docs":{},"登":{"docs":{},"陆":{"docs":{},"的":{"docs":{},"用":{"docs":{},"户":{"docs":{},"(":{"docs":{},"我":{"docs":{},"自":{"docs":{},"己":{"docs":{},")":{"docs":{},"以":{"docs":{},"及":{"docs":{},"用":{"docs":{},"户":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"可":{"docs":{},"能":{"docs":{},"会":{"docs":{},"是":{"docs":{},"这":{"docs":{},"样":{"docs":{},"的":{"docs":{},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"能":{"docs":{},"够":{"docs":{},"生":{"docs":{},"成":{"docs":{},"以":{"docs":{},"下":{"docs":{},"j":{"docs":{},"s":{"docs":{},"o":{"docs":{},"n":{"docs":{},"结":{"docs":{},"果":{"docs":{},":":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}},"这":{"docs":{},"些":{"docs":{},"就":{"docs":{},"是":{"docs":{},"这":{"docs":{},"个":{"docs":{},"部":{"docs":{},"分":{"docs":{},"所":{"docs":{},"写":{"docs":{},"的":{"docs":{},"内":{"docs":{},"容":{"docs":{},"。":{"docs":{"./":{"ref":"./","tf":0.0196078431372549}}}}}}}}}}}}}}}},"#":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}},"[":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}},"]":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}},"a":{"docs":{},"p":{"docs":{},"p":{"docs":{},"e":{"docs":{},"a":{"docs":{},"r":{"docs":{},"s":{"docs":{},"i":{"docs":{},"n":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}},"c":{"docs":{},"o":{"docs":{},"m":{"docs":{},"m":{"docs":{},"e":{"docs":{},"n":{"docs":{},"t":{"docs":{},"s":{"docs":{},"!":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}},"d":{"2":{"docs":{},"\"":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}},",":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}},"”":{"docs":{},"。":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}},"docs":{}},"h":{"docs":{},"e":{"docs":{},"r":{"docs":{},"o":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.03296703296703297}}}}}},"o":{"docs":{},"r":{"docs":{},"g":{"docs":{},"a":{"docs":{},"n":{"docs":{},"a":{"docs":{},"\"":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}},"上":{"docs":{},"面":{"docs":{},"的":{"docs":{},"语":{"docs":{},"句":{"docs":{},"是":{"docs":{},"交":{"docs":{},"互":{"docs":{},"性":{"docs":{},"(":{"docs":{},"i":{"docs":{},"n":{"docs":{},"t":{"docs":{},"e":{"docs":{},"r":{"docs":{},"a":{"docs":{},"c":{"docs":{},"t":{"docs":{},"i":{"docs":{},"v":{"docs":{},"e":{"docs":{},")":{"docs":{},"的":{"docs":{},"。":{"docs":{},"言":{"docs":{},"下":{"docs":{},"之":{"docs":{},"意":{"docs":{},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"按":{"docs":{},"照":{"docs":{},"你":{"docs":{},"的":{"docs":{},"喜":{"docs":{},"好":{"docs":{},"来":{"docs":{},"获":{"docs":{},"取":{"docs":{},"新":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{},"。":{"docs":{},"试":{"docs":{},"着":{"docs":{},"在":{"docs":{},"查":{"docs":{},"询":{"docs":{},"语":{"docs":{},"句":{"docs":{},"里":{"docs":{},"添":{"docs":{},"加":{"docs":{},"一":{"docs":{},"个":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"也":{"docs":{},"能":{"docs":{},"指":{"docs":{},"向":{"docs":{},"对":{"docs":{},"象":{"docs":{},"。":{"docs":{},"在":{"docs":{},"这":{"docs":{},"种":{"docs":{},"情":{"docs":{},"况":{"docs":{},"里":{"docs":{},",":{"docs":{},"你":{"docs":{},"能":{"docs":{},"给":{"docs":{},"那":{"docs":{},"个":{"docs":{},"对":{"docs":{},"象":{"docs":{},"创":{"docs":{},"建":{"docs":{},"一":{"docs":{},"个":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}},"你":{"docs":{},"可":{"docs":{},"以":{"docs":{},"立":{"docs":{},"即":{"docs":{},"看":{"docs":{},"见":{"docs":{},"查":{"docs":{},"询":{"docs":{},"结":{"docs":{},"果":{"docs":{},"有":{"docs":{},"完":{"docs":{},"全":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"结":{"docs":{},"构":{"docs":{},"。":{"docs":{},"这":{"docs":{},"对":{"docs":{},"于":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"来":{"docs":{},"说":{"docs":{},"是":{"docs":{},"很":{"docs":{},"有":{"docs":{},"必":{"docs":{},"要":{"docs":{},"的":{"docs":{},",":{"docs":{},"因":{"docs":{},"为":{"docs":{},"你":{"docs":{},"总":{"docs":{},"是":{"docs":{},"得":{"docs":{},"到":{"docs":{},"你":{"docs":{},"所":{"docs":{},"想":{"docs":{},"要":{"docs":{},"的":{"docs":{},",":{"docs":{},"而":{"docs":{},"且":{"docs":{},"服":{"docs":{},"务":{"docs":{},"器":{"docs":{},"准":{"docs":{},"确":{"docs":{},"的":{"docs":{},"知":{"docs":{},"道":{"docs":{},"客":{"docs":{},"户":{"docs":{},"端":{"docs":{},"要":{"docs":{},"求":{"docs":{},"的":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"s":{"docs":{},"是":{"docs":{},"什":{"docs":{},"么":{"docs":{},"。":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"到":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}},"最":{"docs":{},"简":{"docs":{},"单":{"docs":{},"来":{"docs":{},"说":{"docs":{},",":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"就":{"docs":{},"是":{"docs":{},"关":{"docs":{},"于":{"docs":{},"询":{"docs":{},"问":{"docs":{},"对":{"docs":{},"象":{"docs":{},"里":{"docs":{},"特":{"docs":{},"定":{"docs":{},"的":{"docs":{},"f":{"docs":{},"i":{"docs":{},"e":{"docs":{},"l":{"docs":{},"d":{"docs":{},"s":{"docs":{},"。":{"docs":{},"让":{"docs":{},"我":{"docs":{},"们":{"docs":{},"从":{"docs":{},"看":{"docs":{},"一":{"docs":{},"个":{"docs":{},"非":{"docs":{},"常":{"docs":{},"简":{"docs":{},"单":{"docs":{},"的":{"docs":{},"语":{"docs":{},"句":{"docs":{},"和":{"docs":{},"运":{"docs":{},"行":{"docs":{},"之":{"docs":{},"后":{"docs":{},"获":{"docs":{},"得":{"docs":{},"的":{"docs":{},"结":{"docs":{},"果":{"docs":{},"开":{"docs":{},"始":{"docs":{},":":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"的":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}},"回":{"docs":{},"馈":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}},"类":{"docs":{},"型":{"docs":{},",":{"docs":{},"在":{"docs":{},"这":{"docs":{},"个":{"docs":{},"情":{"docs":{},"况":{"docs":{},"下":{"docs":{},"是":{"docs":{},"星":{"docs":{},"际":{"docs":{},"争":{"docs":{},"霸":{"docs":{},"主":{"docs":{},"角":{"docs":{},"英":{"docs":{},"雄":{"docs":{},"的":{"docs":{},"名":{"docs":{},"字":{"docs":{},"“":{"docs":{},"r":{"2":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}},"docs":{}}}}}}}}}}}}}}}}}}}}}}}},"返":{"docs":{},"回":{"docs":{},"一":{"docs":{},"个":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}},"了":{"docs":{},"一":{"docs":{},"组":{"docs":{},"数":{"docs":{},"据":{"docs":{},"单":{"docs":{},"元":{"docs":{},"。":{"docs":{},"对":{"docs":{},"于":{"docs":{},"g":{"docs":{},"r":{"docs":{},"a":{"docs":{},"p":{"docs":{},"h":{"docs":{},"q":{"docs":{},"l":{"docs":{},"语":{"docs":{},"句":{"docs":{},"来":{"docs":{},"说":{"docs":{},",":{"docs":{},"单":{"docs":{},"数":{"docs":{},"据":{"docs":{},"元":{"docs":{},"还":{"docs":{},"是":{"docs":{},"一":{"docs":{},"个":{"docs":{},"列":{"docs":{},"表":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"元":{"docs":{},"都":{"docs":{},"是":{"docs":{},"一":{"docs":{},"样":{"docs":{},"的":{"docs":{},",":{"docs":{},"但":{"docs":{},"是":{"docs":{},"基":{"docs":{},"于":{"docs":{},"表":{"docs":{},"达":{"docs":{},"的":{"docs":{},"数":{"docs":{},"据":{"docs":{},"模":{"docs":{},"式":{"docs":{},"我":{"docs":{},"们":{"docs":{},"知":{"docs":{},"道":{"docs":{},"最":{"docs":{},"后":{"docs":{},"会":{"docs":{},"获":{"docs":{},"得":{"docs":{},"的":{"docs":{},"是":{"docs":{},"哪":{"docs":{},"一":{"docs":{},"个":{"docs":{},"。":{"docs":{"chapter1.html":{"ref":"chapter1.html","tf":0.01098901098901099}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"length":84},"corpusTokens":["\"data\":","\"friends\":","\"han","\"hero\":","\"leia","\"luke","\"me\":","\"name\":","\"r2","#","[","]","appearsin","comments!","d2\"","d2\",","d2”。","field","fields,让客户端能够在一次请求中获取到多个相关数据,而不是像传统的rest架构里需要反复请求多次。","friend","function","graphql","graphql介绍","graphql是一种支持api的查询语言,同时也是根据你的数据自定义类型(type)系统的服务端热执行查询。graphql并没有绑定任何数据库或内存引擎,而是完全基于你现有的代码和数据。","hero","id","id:","me:","mutations)","name","name:","organa\"","queri","query_me(request)","request.auth.user;","return","selection。graphql语句能遍历相关联的对象和它们的","skywalker\"","solo\"","string","sub","type","user","user.getname();","user_name(user)","{","}","},","一个graphql服务是通过定义类型(type)和type上的fields,","上面的语句是交互性(interactive)的。言下之意你可以按照你的喜好来获取新的结果。试着在查询语句里添加一个","也能指向对象。在这种情况里,你能给那个对象创建一个","介绍","你可以立即看见查询结果有完全一样的数据结构。这对于graphql来说是很有必要的,因为你总是得到你所想要的,而且服务器准确的知道客户端要求的fields是什么。","到","在之前的例子里,我们只是查询英雄的名字对应","在这一系列的文章中我们将学习graphql是怎样工作的。想要通过文档知道如何打造graphql服务?这里有一些库可以帮助你在很多不同语言里实现graphql。","在这一页里,你将会了解到如何在一个graphql服务器上查询。","在这个例子中可以看到,friend","学习更多关于graphql","对了,还有一件事","对应每一个type里的field的函数:","对象里,然后看新的结果","当一个graphql服务正在运行时(通常在一个web服务的url上),可以通过发送graphql语句来进行验证和执行。一个收到的查询语句会首先被检查以保证它被指向被定义的types和fields,然后运行提供的函数来执行结果。","最简单来说,graphql就是关于询问对象里特定的fields。让我们从看一个非常简单的语句和运行之后获得的结果开始:","查询语句和转变","查询语句和转变(queri","查询语句,类型系统,graphql服务如何工作,以及用graphql来解决一般问题的最佳实践","比如这个语句:","然后给每一个type里的fields提供函数来创建的。比如,一个graphql服务要告诉我们谁是已登陆的用户(我自己)以及用户的名字可能会是这样的:","的","的回馈,但是","类型,在这个情况下是星际争霸主角英雄的名字“r2","能够生成以下json结果:","返回一个","返回了一组数据单元。对于graphql语句来说,单数据元还是一个列表的数据元都是一样的,但是基于表达的数据模式我们知道最后会获得的是哪一个。","这些就是这个部分所写的内容。"],"pipeline":["stopWordFilter","stemmer"]},"store":{"./":{"url":"./","title":"GraphQL 介绍","keywords":"","body":"GraphQL介绍\n\n在这一系列的文章中我们将学习GraphQL是怎样工作的。想要通过文档知道如何打造GraphQL服务?这里有一些库可以帮助你在很多不同语言里实现GraphQL。\n\nGraphQL是一种支持API的查询语言,同时也是根据你的数据自定义类型(type)系统的服务端热执行查询。GraphQL并没有绑定任何数据库或内存引擎,而是完全基于你现有的代码和数据。\n一个GraphQL服务是通过定义类型(type)和type上的fields, 然后给每一个type里的fields提供函数来创建的。比如,一个GraphQL服务要告诉我们谁是已登陆的用户(我自己)以及用户的名字可能会是这样的:\ntype Query {\n me: User\n}\n\ntype User {\n id: ID\n name: String\n}\n对应每一个type里的field的函数:\nfunction Query_me(request) {\n return request.auth.user;\n}\n\nfunction User_name(user) {\n return user.getName();\n}\n当一个GraphQL服务正在运行时(通常在一个web服务的URL上),可以通过发送GraphQL语句来进行验证和执行。一个收到的查询语句会首先被检查以保证它被指向被定义的types和fields,然后运行提供的函数来执行结果。\n比如这个语句:\n{\n me {\n name\n }\n}\n能够生成以下JSON结果:\n{\n \"me\": {\n \"name\": \"Luke Skywalker\"\n }\n}\n学习更多关于GraphQL - 查询语句,类型系统,GraphQL服务如何工作,以及用GraphQL来解决一般问题的最佳实践 - 这些就是这个部分所写的内容。\n"},"chapter1.html":{"url":"chapter1.html","title":"查询语句和转变","keywords":"","body":"查询语句和转变(Queries and Mutations)\n在这一页里,你将会了解到如何在一个GraphQL服务器上查询。\nFields\n最简单来说,GraphQL就是关于询问对象里特定的fields。让我们从看一个非常简单的语句和运行之后获得的结果开始:\n{\n hero {\n name\n }\n}\n\n{\n \"data\": {\n \"hero\": {\n \"name\": \"R2-D2\"\n }\n }\n}\n\n你可以立即看见查询结果有完全一样的数据结构。这对于GraphQL来说是很有必要的,因为你总是得到你所想要的,而且服务器准确的知道客户端要求的fields是什么。\nField name 返回一个 String 类型,在这个情况下是星际争霸主角英雄的名字“R2-D2”。\n\n对了,还有一件事 - 上面的语句是交互性(interactive)的。言下之意你可以按照你的喜好来获取新的结果。试着在查询语句里添加一个 appearsIn field 到 hero 对象里,然后看新的结果\n\n在之前的例子里,我们只是查询英雄的名字对应 String 的回馈,但是 fields 也能指向对象。在这种情况里,你能给那个对象创建一个 fields 的 sub-selection。GraphQL语句能遍历相关联的对象和它们的 fields,让客户端能够在一次请求中获取到多个相关数据,而不是像传统的REST架构里需要反复请求多次。\n{\n hero {\n name\n # Queries can have comments!\n friends {\n name\n }\n }\n}\n{\n \"data\": {\n \"hero\": {\n \"name\": \"R2-D2\",\n \"friends\": [\n {\n \"name\": \"Luke Skywalker\"\n },\n {\n \"name\": \"Han Solo\"\n },\n {\n \"name\": \"Leia Organa\"\n }\n ]\n }\n }\n}\n在这个例子中可以看到,friends field 返回了一组数据单元。对于GraphQL语句来说,单数据元还是一个列表的数据元都是一样的,但是基于表达的数据模式我们知道最后会获得的是哪一个。\n"}}}