<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=GraphQL</id>
	<title>GraphQL - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=GraphQL"/>
	<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=GraphQL&amp;action=history"/>
	<updated>2026-06-24T23:31:29Z</updated>
	<subtitle>在这个wiki上该页的修订历史</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://arolstar52-zhtest.hf.space/index.php?title=GraphQL&amp;diff=3139393&amp;oldid=prev</id>
		<title>imported&gt;ExultantEditor 来自 2025年12月26日 (五) 17:27</title>
		<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=GraphQL&amp;diff=3139393&amp;oldid=prev"/>
		<updated>2025-12-26T17:27:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{roughtranslation|time=2018-11-08T05:56:05+00:00}}&lt;br /&gt;
{{Expand English}}&lt;br /&gt;
{{NoteTA|G1=IT|G2=FL}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name = GraphQL&lt;br /&gt;
| logo = GraphQL Logo.svg&lt;br /&gt;
| logo size = 160px&lt;br /&gt;
| screenshot = &lt;br /&gt;
| caption = &lt;br /&gt;
| author = &lt;br /&gt;
| developer = [[Facebook]]及社区&lt;br /&gt;
| released = {{Start date|2015|09|14}}&lt;br /&gt;
| latest release version = {{start date|2018|06}}&amp;lt;ref name=&amp;quot;graphql_release&amp;quot;&amp;gt;{{cite web | url=https://github.com/graphql/graphql-spec/releases/tag/June2018 | title=GraphQL June 2018 Release Notes | accessdate=26 March 2019 | archive-date=2020-10-16 | archive-url=https://web.archive.org/web/20201016193418/https://github.com/graphql/graphql-spec/releases/tag/June2018 | dead-url=no }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| status = 活跃&lt;br /&gt;
| programming language = 在 [[JavaScript]]、[[Ruby]]、[[Scala]]和其他各种语言中实现。&lt;br /&gt;
| operating system = [[跨平台]]&lt;br /&gt;
| repo = {{URL|https://github.com/facebook/graphql}}&lt;br /&gt;
| website = {{URL|https://graphql.org/}}&lt;br /&gt;
}}&lt;br /&gt;
GraphQL是一个开源的，面向API而创造出来的数据查询操作语言以及相应的运行环境。&amp;lt;ref name=&amp;quot;graphql-website&amp;quot;&amp;gt;{{Cite web|url=http://graphql.org/|title=GraphQL: A query language for APIs.|publisher=|accessdate=2018-11-08|archive-date=2016-04-26|archive-url=https://web.archive.org/web/20160426145914/http://graphql.org/|dead-url=yes}}&amp;lt;/ref&amp;gt; 于2012年仍处于Facebook内部开发阶段，直到2015年才公开发布。 2018年11月7日，Facebook将GraphQL项目转移到新成立的GraphQL基金会（隶属于非营利性的[[Linux基金会]]）。&amp;lt;ref&amp;gt;{{Cite news|url=https://techcrunch.com/2018/11/06/facebooks-graphql-gets-its-own-open-source-foundation/|title=Facebook’s GraphQL gets its own open-source foundation|work=TechCrunch|accessdate=2018-11-07|language=en-US|archive-date=2019-01-22|archive-url=https://web.archive.org/web/20190122103713/https://techcrunch.com/2018/11/06/facebooks-graphql-gets-its-own-open-source-foundation/|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite news|url=https://www.linuxfoundation.org/press-release/2018/11/intent_to_form_graphql/|title=The Linux Foundation Announces Intent to Form New Foundation to Support GraphQL - The Linux Foundation|date=2018-11-06|work=The Linux Foundation|accessdate=2018-11-07|language=en-US|archive-date=2019-01-28|archive-url=https://web.archive.org/web/20190128030155/https://www.linuxfoundation.org/press-release/2018/11/intent_to_form_graphql/|dead-url=yes}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GraphQL相较于[[表现层状态转换|REST]]以及其他[[Web服务|web service]]架构提供了一种更加高效、强大和灵活的开发web APIs的方式。它通过由客户端根据所需定义数据结构，同时由服务端负责返回相同数据结构的对应数据的方式避免了服务端大量冗余数据的返回，但与此同时也意味着这种方式不能有效利用起查询结果的web缓存。GraphQL这种查询语言所带来的灵活性和丰富性的同时也增加了复杂性，导致简单的APIs有可能并不适合这种方式。&amp;lt;ref&amp;gt;{{Cite news|url=https://philsturgeon.uk/api/2017/01/24/graphql-vs-rest-overview/|title=GraphQL vs REST: Overview|work=Phil Sturgeon|access-date=2018-11-25|language=en-GB|archive-date=2019-04-08|archive-url=https://web.archive.org/web/20190408175454/https://philsturgeon.uk/api/2017/01/24/graphql-vs-rest-overview/|dead-url=yes}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite news|url=https://honest.engineering/posts/why-use-graphql-good-and-bad-reasons|title=Why use GraphQL, good and bad reasons|date=2018-08-04|work=Honest Engineering|access-date=2018-11-26|language=en-US|archive-date=2018-11-26|archive-url=https://web.archive.org/web/20181126051100/https://honest.engineering/posts/why-use-graphql-good-and-bad-reasons|dead-url=yes}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web|url=https://www.howtographql.com/basics/0-introduction/|title=GraphQL Fundamentals|website=Howto GraphQL|accessdate=2018-07-04|archive-date=2018-07-05|archive-url=https://web.archive.org/web/20180705062729/https://www.howtographql.com/basics/0-introduction/|dead-url=yes}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GraphQL支持数据读取、写入（操作）和数据变更订阅（实时更新）。&amp;lt;ref&amp;gt;{{Cite web |url=https://facebook.github.io/graphql/June2018/#sec-Language.Operations |title=GraphQL |accessdate=2018-07-04 |work=facebook.github.io |publisher=[[Facebook]] |archive-url=https://web.archive.org/web/20180718051011/http://facebook.github.io/graphql/June2018/#sec-Language.Operations |archive-date=2018-07-18 |dead-url=yes }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
主要的GraphQL客户端有Apollo Client&amp;lt;ref&amp;gt;{{cite web|url=https://www.apollographql.com/client|title=Apollo Client: The flexible, production ready GraphQL client for React, and all JavaScript and native apps|publisher=|accessdate=2019-01-24|archive-date=2018-07-20|archive-url=https://web.archive.org/web/20180720164209/https://www.apollographql.com/client/|dead-url=yes}}&amp;lt;/ref&amp;gt; 和 Relay.&amp;lt;ref&amp;gt;{{cite web|url=https://facebook.github.io/relay/|title=Relay: A JavaScript framework for building data-driven React applications|publisher=|accessdate=2019-01-24|archive-date=2019-01-29|archive-url=https://web.archive.org/web/20190129013209/https://facebook.github.io/relay/|dead-url=yes}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
GraphQL的服务端在多个语言都有实现包括Haskell, JavaScript, Python,&amp;lt;ref&amp;gt;{{Cite web|url=http://graphene-python.org|title=Graphene|website=graphene-python.org|access-date=2017-06-18|archive-date=2015-10-12|archive-url=https://web.archive.org/web/20151012183218/http://graphene-python.org/|dead-url=yes}}&amp;lt;/ref&amp;gt; Ruby, Java, C#, Scala, Go, Elixir,&amp;lt;ref&amp;gt;{{cite web |title=Absinthe: The GraphQL toolkit for Elixir |url=http://absinthe-graphql.org/ |accessdate=2018-07-19 |archive-date=2018-07-06 |archive-url=https://web.archive.org/web/20180706020058/http://absinthe-graphql.org/ |dead-url=yes }}&amp;lt;/ref&amp;gt; Erlang, PHP, R,和 Clojure.&lt;br /&gt;
&lt;br /&gt;
2018年2月9日GraphQL的部分模式定义语言（SDL）规范制定完成。&lt;br /&gt;
&lt;br /&gt;
==例子==&lt;br /&gt;
[[POST (HTTP)|POST]]请求：&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    orders {&lt;br /&gt;
        id&lt;br /&gt;
        productsList {&lt;br /&gt;
            product {&lt;br /&gt;
                name&lt;br /&gt;
                price&lt;br /&gt;
            }&lt;br /&gt;
            quantity&lt;br /&gt;
        }&lt;br /&gt;
        totalAmount&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
响应：&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;data&amp;quot;: {&lt;br /&gt;
        &amp;quot;orders&amp;quot;: [&lt;br /&gt;
            {&lt;br /&gt;
                &amp;quot;id&amp;quot;: 1,&lt;br /&gt;
                &amp;quot;productsList&amp;quot;: [&lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;product&amp;quot;: {&lt;br /&gt;
                            &amp;quot;name&amp;quot;: &amp;quot;orange&amp;quot;,&lt;br /&gt;
                            &amp;quot;price&amp;quot;: 1.5&lt;br /&gt;
                        },&lt;br /&gt;
                        &amp;quot;quantity&amp;quot;: 100&lt;br /&gt;
                    }&lt;br /&gt;
                ],&lt;br /&gt;
                &amp;quot;totalAmount&amp;quot;: 150&lt;br /&gt;
            }&lt;br /&gt;
        ]&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 参见 ==&lt;br /&gt;
&lt;br /&gt;
*{{le|Query by Example}}&lt;br /&gt;
&lt;br /&gt;
== 参考文献 ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
== 外部链接 ==&lt;br /&gt;
&lt;br /&gt;
* {{Official website|https://graphql.org/}}&lt;br /&gt;
* [https://github.com/APIs-guru/graphql-apis List of public GraphQL APIs] {{Wayback|url=https://github.com/APIs-guru/graphql-apis |date=20201207225723 }}&lt;br /&gt;
&lt;br /&gt;
{{查询语言}}&lt;br /&gt;
&lt;br /&gt;
[[Category:数据查询语言]]&lt;br /&gt;
[[Category:数据建模语言]]&lt;/div&gt;</summary>
		<author><name>imported&gt;ExultantEditor</name></author>
	</entry>
</feed>