nikon是什么牌子| 孕妇喝可乐对胎儿有什么影响| 此情可待什么意思| 喉咙痛吃什么药好| eod是什么意思| 坐月子能吃什么| 草字头下面一个高字读什么| 秋葵与什么菜相克| 什么书没有字| 鱼缸什么材质的好| 新发展理念是什么| 生蒜头吃了有什么好处和坏处| 男人喝什么酒壮阳最快| 蚊虫叮咬红肿用什么药快速消肿| 老佛爷是什么牌子| 做梦梦到怀孕了是什么意思| 什么叫血糖| 何以笙箫默什么意思| 沉鱼落雁闭月羞花什么意思| 鹰嘴桃什么时候成熟| 去医院看心理挂什么科| 复方阿胶浆适合什么样的人喝| 花花世界不必当真是什么歌| 女人佩戴什么增加阳气| pop是什么意思| 炖羊排放什么调料好吃| 舌强语謇是什么意思| 申的五行属什么| 三公是什么意思| 为什么水不会燃烧| 一什么一什么词语| 骨质密度不均匀是什么意思| 输卵管堵塞吃什么药可以疏通| 花椒有什么功效与作用| 美什么美什么| rh血型阳性是什么意思| 脚底发红是什么原因| 肛门塞什么东西最舒服| lee是什么档次| 吃什么食物养胃| 道是什么| 马蹄铁什么时候发明的| 狗咬到什么程度需要打针| 尿的颜色有点红褐色是什么原因| 矫正度数是什么意思| 卡马西平片治什么病| 月亮星座是什么| 梦到自己头发白了是什么意思| 澳门为什么叫澳门| 痤疮涂什么药膏| 九五至尊是什么生肖| 嗓子疼吃什么食物好| 栀子花叶子发黄是什么原因| 西天取经是什么意思| 辰时是什么时候| 摧残是什么意思| 美国为什么那么强大| 煮黑豆吃有什么功效| 偏头痛吃什么药效果好| 什么是情劫| 梦见牛顶我是什么意思| 小孩嘴唇发红是什么原因| 痢疾吃什么药效果最好| 什么的海底| 七喜是什么饮料| 凉白开是什么水| 达字五行属什么| 什么东西一吃就死| 手心脚心热是什么原因| 血压高压高低压正常是什么原因| 自汗是什么意思| 头皮屑多是什么原因引起的| 脾肾阴虚有什么症状| 红斑狼疮是什么症状| 1960年属鼠的是什么命| 梦见涨水是什么征兆| 喝什么对嗓子好| 肛门出血是什么原因| 美莎片是什么药| 5月9号是什么星座| 留意是什么意思| 鱼露是什么| 乙肝25阳性什么意思| 泼皮是什么意思| 什么可以变白皮肤| 香港什么时候回归| 梦见朋友结婚是什么意思| 言字旁与什么有关| 为什么硬不起来| 72年属什么生肖| 查血常规能查出什么| 戒心是什么意思| mri什么意思| cg是什么意思| 眼睛模糊吃什么药| 老鼠和什么属相最配对| 耻骨高是什么原因| 什么是痰湿| 水瓶是什么象星座| 八月十七是什么星座| 犯了痔疮为什么老放屁| 王牌是什么意思| 擅长是什么意思| 手表什么牌子| 什么的秃鹫| 布克兄弟什么档次| 胸口疼挂什么科| 眼底筛查是检查什么| no.是什么意思| 微信上面有个耳朵是什么意思| 日希是什么字| 女性夜尿多是什么原因| cba什么意思| 卡他症状是什么意思| 什么是人肉搜索| 吃什么鱼最健康| 海澜之家是什么档次| 玄关挂什么装饰画好| 咳嗽吃什么| 脚肿是什么病| 不由自主的摇头是什么病| 发冷发热是什么原因| 搞基是什么意思| 尿隐血是什么原因引起的| 血压低有什么办法| 什么的水| 转氨酶高是什么| 上火吃什么药最有效果| 食管反流什么症状| 急于求成是什么意思| 猫爪草有什么功效| 施华洛世奇算什么档次| 开眼镜店需要什么设备| 什么是bp| 喝酒容易醉是什么原因| 叶酸什么时间吃最好| 茶禅一味是什么意思| 盲从什么意思| 细水长流是什么意思| 地贫是什么| 泌尿科属于什么科| 冷的什么| 张少华什么时候去世的| 7什么意思| 手不释卷的释是什么意思| 眉心跳动代表什么预兆| 93年什么命| 子宫内膜什么时候脱落| 破绽是什么意思| 牛栏坑肉桂属于什么茶| 你想吃什么| 左耳长痣代表什么| oa是什么| 荷花是什么季节开的| 稠的反义词是什么| 吃什么清肝火最快| 眉毛中间叫什么部位| 挂绿荔枝为什么那么贵| 血红素是什么| 甘油三酯高说明什么| 皇子的妻子叫什么| igm阳性是什么意思| 1969属什么生肖| 与狼共舞什么意思| 猪沙肝是什么部位| 什么动物吃草| 羊水破了有什么感觉| 冷感冒吃什么药好得快| 什么杀精子最厉害| 男性早泄吃什么药| 低蛋白血症是什么病| 士多啤梨是什么水果| 脚气是什么样的图片| 什么是自我| 什么是良心| 泛性恋是什么意思| 养鱼为什么养单不养双| 失眠吃什么中成药效果最好| 人体最大器官是什么| 脸黄是什么原因造成的| 回应是什么意思| 做肺部ct挂什么科| 长痘要忌口什么东西| 上火喝什么茶| 995是什么意思| 阁楼是什么意思| 好好好是什么语气| 年收入10万什么水平| 早餐吃什么好| 两岁宝宝不会说话但什么都知道| 五月二十二是什么星座| 吃什么可以提高血小板| 什么得直什么| 牙龈出血是什么病的前兆| 粗糙的什么| 什么津津| 副高是什么职称| 声音小是什么原因| 乳糖不耐受可以喝什么奶| 主动脉硬化是什么意思| 孕妇耻骨疼是什么原因| 仁义道德是什么意思| 金箔是什么| 宝姿是什么档次的牌子| 十月一日是什么日子| 天秤座男生喜欢什么样的女生| 外阴长什么样| 小肚子胀是什么原因女性| 数据是什么意思| 国企是什么| ml什么单位| 谜底是什么意思| 七月什么星座| 阴茎插入阴道是什么感觉| 榴莲什么季节吃最好| 什么是躁郁症| 耳石症是什么症状| dr是什么| 色弱是什么| 事宜愿为是什么意思| 手指缝痒是什么原因| twins是什么意思| 宫腔线分离是什么意思| 3f是什么意思| 13岁属什么| 6月份出生是什么星座| 乳头痒是什么原因| 2月5号什么星座| mirage轮胎什么牌子| rh是什么元素| 扁桃体肿大有什么症状| 舍本逐末是什么意思| 上海古代叫什么| cst是什么意思| 什么床最环保没甲醛| 格列本脲和格列美脲有什么区别| 蛇缠腰是什么病怎么治| 低血压高什么原因| 做梦梦到自己生病了是什么意思| 气节是什么意思| 为什么月经量少| 蛇最怕什么东西| 九加虎念什么| 什么就像什么一样| SEX是什么| 什么是工作| 下焦湿热吃什么中成药| 慌张的近义词是什么| 后脑勺长白头发是什么原因| 一个点念什么| 乳腺钼靶是什么意思| 琥珀色是什么颜色| 主任是什么级别| 抽筋吃什么药见效快| 芈月和秦始皇是什么关系| 凉茶是什么茶| 花中皇后是什么花| 额头发黑是什么原因| 刘禅属什么生肖| 为什么叫买东西不叫买南北| 心脏突然剧烈跳动是什么原因| 嗓子疼吃什么药最管用| 梦见豆腐是什么意思| 背痛是什么原因引起的| 百度Jump to content

李伟波慈善基金会捐资逾亿资助世界著名高校产学研

From Wikipedia, the free encyclopedia
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
GraphQL
Original author(s)Meta Platforms
Developer(s)The GraphQL Foundation
Initial releaseSeptember 14, 2015 (2025-08-05)
Stable release
October 2021 (2021-10)[1]
Repositorygithub.com/graphql/graphql-spec
Written inImplementations in Java, JavaScript, Ruby, Scala, others.
Websitegraphql.org
百度 第十三条资助期刊主办单位财务部门应妥善保存资金账目和单据。

GraphQL is a data query and manipulation language that allows specifying what data is to be retrieved ("declarative data fetching") or modified. A GraphQL server can process a client query using data from separate sources and present the results in a unified graph.[2] The language is not tied to any specific database or storage engine. There are several open-source runtime engines for GraphQL.

History

Facebook started GraphQL development in 2012 and released a draft specification and reference implementation as open source in 2015.[3] In 2018, GraphQL was moved to the newly established GraphQL Foundation, hosted by the non-profit Linux Foundation.[4][5]

On February 9, 2018, the GraphQL Schema Definition Language became part of the specification.[6]

Many popular public APIs adopted GraphQL as the default way to access them. These include public APIs of Facebook, GitHub, Yelp, Shopify, Google Directions API and many others.[7][8]

Design

GraphQL supports reading, writing (mutating), and subscribing to changes to data (realtime updates – commonly implemented using WebSockets).[9] A GraphQL service is created by defining types with fields, then providing functions to resolve the data for each field. The types and fields make up what is known as the schema definition. The functions that retrieve and map the data are called resolvers.[10]

After being validated against the schema, a GraphQL query is executed by the server. The server returns a result that mirrors the shape of the original query, typically as JSON.[11]

Type system

Schema of swapi-graphql rendered as a graph by GraphQL Voyager

With GraphQL, you model your business domain as a graph by defining a schema; within your schema, you define different types of nodes and how they connect/relate to one another.[12]

The GraphQL type system describes what data can be queried from the API. The collection of those capabilities is referred to as the service’s schema and clients can use that schema to send queries to the API that return predictable results.[13]

The root type of a GraphQL schema, Query by default, contains all of the fields that can be queried. Other types define the objects and fields that the GraphQL server can return. There are several base types, called scalars, to represent things like strings, numbers, and IDs.

Fields are defined as nullable by default, and a trailing exclamation mark can be used to make a field non-nullable (required). A field can be defined as a list by wrapping the field's type in square brackets (for example, authors: [String]).[14]

type Query {
  currentUser: User
}

type User {
  id: ID!
  name: String!
}

Queries

A GraphQL query defines the exact shape of the data needed by the client.

query CurrentUser {
  currentUser {
    name
    age
  }
}

Once validated and executed by the GraphQL server, the data is returned in the same shape.

{
  "currentUser": {
    "name": "John Doe",
    "age": 23
  }
}

Mutations

A GraphQL mutation allows for data to be created, updated, or deleted. Mutations generally contain variables, which allow data to be passed into the server from the client. The mutation also defines the shape of the data that will be returned to the client after the operation is complete.

mutation CreateUser($name: String!, $age: Int!) {
  createUser(userName: $name, age: $age) {
    name
    age
  }
}

The variables are passed as an object with fields that match the variable names in the mutation.

{
  "name": "Han Solo",
  "age": 42
}

Once the operation is complete, the GraphQL server will return data matching the shape defined by the mutation.

{
  "data": {
    "createUser": {
      "name": "Han Solo",
      "age": 42
    }
  }
}

Subscriptions

GraphQL also supports live updates sent from the server to client in an operation called a subscription. Again, the client defines the shape of the data that it needs whenever an update is made.

subscription {
  newPerson {
    name
    age
  }
}

When a mutation is made through the GraphQL server that updates the associated field, data is sent to all subscribed clients in the format setup through the subscription.

{
  "newPerson": {
    "name": "Jane",
    "age": 23
  }
}

Versioning

While there’s nothing that prevents a GraphQL service from being versioned just like any other API, GraphQL takes a strong opinion on avoiding versioning by providing the tools for the continuous evolution of a GraphQL schema.[15]

The @deprecated built-in directive is used within the type system definition language to indicate deprecated portions of a GraphQL service’s schema, such as deprecated fields on a type or deprecated enum values.[14]

GraphQL only returns the data that’s explicitly requested, so new capabilities can be added via new types or new fields on existing types without creating a breaking change. This has led to a common practice of always avoiding breaking changes and serving a versionless API.[15]

Comparison to other query languages

GraphQL does not provide a full-fledged graph query language such as SPARQL, or even in dialects of SQL that support transitive closure. For example, a GraphQL interface that reports the parents of an individual cannot return, in a single query, the set of all their ancestors.

Testing

GraphQL APIs can be tested manually or with automated tools issuing GraphQL requests and verifying the correctness of the results. Automatic test generation is also possible.[16] New requests may be produced through search-based techniques due to a typed schema and introspection capabilities.[17]

Some of the software tools used for testing GraphQL implementations include Postman, GraphiQL, Apollo Studio, GraphQL Hive, GraphQL Editor, and Step CI.[18]

See also

References

  1. ^ "GraphQL October 2021 Release Notes". GitHub.
  2. ^ "Learn GraphQL Fundamentals with Fullstack Tutorial". www.howtographql.com. Retrieved 25 April 2023.
  3. ^ "GraphQL: A data query language". 14 September 2015.
  4. ^ "Facebook's GraphQL gets its own open-source foundation". TechCrunch. Retrieved 7 November 2018.
  5. ^ "The Linux Foundation Announces Intent to Form New Foundation to Support GraphQL". The Linux Foundation. 6 November 2018. Retrieved 17 March 2023.
  6. ^ "GraphQL SDL included in Github repository". GitHub.
  7. ^ "GraphQL Landscape". landscape.graphql.org. 5 July 2025.
  8. ^ graphql-kit/graphql-apis, graphql-kit, 31 May 2025, retrieved 5 June 2025
  9. ^ "GraphQL". facebook.github.io. Facebook. Archived from the original on 18 July 2018. Retrieved 4 July 2018.
  10. ^ "Introduction to GraphQL". graphql.org. Retrieved 25 April 2023.
  11. ^ "Execution". graphql.org. Retrieved 25 April 2023.
  12. ^ "Thinking in Graphs | GraphQL". graphql.org. Retrieved 3 June 2025.
  13. ^ "Schemas and Types | GraphQL". graphql.org. Retrieved 3 June 2025.
  14. ^ a b "GraphQL". spec.graphql.org. Retrieved 25 April 2023.
  15. ^ a b "Schema Design | GraphQL". graphql.org. Retrieved 3 June 2025.
  16. ^ Vargas, D. M.; Blanco, A. F.; Vidaurre, A. C.; Alcocer, J. P. S.; Torres, M. M.; Bergel, A.; Ducasse, S. (2018). "Deviation Testing: A Test Case Generation Technique for GraphQL APIs" (PDF). 11th International Workshop on Smalltalk Technologies (IWST): 1–9.
  17. ^ Karlsson, Stefan; Causevic, Adnan; Sundmark, Daniel (May 2021). "Automatic Property-based Testing of GraphQL APIs". 2021 IEEE/ACM International Conference on Automation of Software Test (AST). Madrid, Spain: IEEE. pp. 1–10. arXiv:2012.07380. doi:10.1109/AST52587.2021.00009. ISBN 978-1-6654-3567-3. S2CID 229156477.
  18. ^
    "Hive Laboratory". Hive Documentation. Retrieved 26 November 2024.
hrv什么意思 腊月二十三是什么星座 白细胞2加号什么意思 乌灵参是什么东西 胃糜烂是什么症状
人的血压一天中什么时候最高 花名册是什么意思 大拇指旁边是什么指 你的名字讲的什么故事 肝多发钙化灶什么意思
7月1号是什么节日 bppv是什么病 盆腔炎吃什么消炎药 生死有命富贵在天什么意思 认知什么意思
做心电图挂什么科 手表什么牌子 皮疹是什么样子的 汗蒸有什么好处和功效 铁线虫是什么
高笋和茭白有什么区别hcv8jop4ns1r.cn 动脉抽血是做什么检查hcv7jop6ns2r.cn 结扎对女人有什么伤害hcv9jop8ns3r.cn 脂肪酶是什么hcv8jop8ns8r.cn 一纸空文是什么意思hcv8jop4ns0r.cn
鞋子eur是什么意思hcv9jop6ns1r.cn 孕早期需要注意什么hcv8jop9ns3r.cn 哂是什么意思hcv8jop5ns8r.cn 钓黑鱼用什么饵最好hcv8jop8ns6r.cn 认识是什么意思hcv8jop6ns3r.cn
银行行长是什么级别jingluanji.com 甲状腺结节低回声什么意思hcv7jop9ns5r.cn 子宫和宫颈有什么区别hcv8jop2ns2r.cn 手镯断了有什么预兆hcv8jop9ns5r.cn 步履匆匆的意思是什么hcv7jop5ns2r.cn
刮宫是什么意思hcv9jop7ns3r.cn 祈字五行属什么hcv9jop2ns9r.cn c肽测定是什么意思hcv8jop9ns2r.cn 珏字五行属什么hcv9jop7ns4r.cn lo是什么意思hcv9jop8ns2r.cn
百度