Mutations #Facebook Relay文档翻译#
来源:互联网 发布:济南易途java培训骗局 编辑:程序博客网 时间:2024/05/18 02:02
原文地址
上一篇 Connection
Relay文档翻译目录
Relay uses a common pattern for mutations, where they are root fields on the
mutation type with a single argument, input
, and where the input and output
both contain a client mutation identifier used to reconcile requests and
responses.
Relay使用通用模式来处理mutation,定义为mutation type带有一个参数input的根字段,这里的输入输出都包含客户端mutation标识符用于撮合请求与响应。
By convention, mutations are named as verbs, their inputs are the name with
“Input” appended at the end, and they return an object that is the name with
“Payload” appended.
按照约定,mutation的名字用动词,他们的输入名字以’Input’结尾,返回的对象的名字以’Payload’结尾。
So for our introduceShip
mutation, we create two types: IntroduceShipInput
and IntroduceShipPayload
:
input IntroduceShipInput { factionId: ID! shipName: String! clientMutationId: String!}type IntroduceShipPayload { faction: Faction ship: Ship clientMutationId: String!}
With this input and payload, we can issue the following mutation:
mutation AddBWingQuery($input: IntroduceShipInput!) { introduceShip(input: $input) { ship { id name } faction { name } clientMutationId }}
with these params:
{ "input": { "shipName": "B-Wing", "factionId": "1", "clientMutationId": "abcde" }}
and we’ll get this result:
{ "introduceShip": { "ship": { "id": "U2hpcDo5", "name": "B-Wing" }, "faction": { "name": "Alliance to Restore the Republic" }, "clientMutationId": "abcde" }}
Complete details on how the server should behave are
available in the GraphQL Input Object Mutations
spec.
服务器端应该如何处理的详细说明请见GraphQL Input Object Mutations
spec.
- Mutations #Facebook Relay文档翻译#
- Mutations #Facebook Relay文档翻译#
- Babel Relay Plugin #Facebook Relay文档翻译#
- GraphQL Relay Specification #Facebook Relay文档翻译#
- Thinking In Relay #Facebook Relay文档翻译#
- Tutorial #Facebook Relay文档翻译#
- Containers #Facebook Relay文档翻译#
- Routes #Facebook Relay文档翻译#
- Connection #Facebook Relay文档翻译#
- Relay文档翻译目录 #Facebook Relay文档翻译#
- Getting Start #Facebook Relay文档翻译#
- Root Container #Facebook Relay文档翻译#
- Ready State #Facebook Relay文档翻译#
- Network Layer #Facebook Relay文档翻译#
- Object Identification #Facebook Relay文档翻译#
- Thinking in GraphQL #Facebook Relay文档翻译#
- Mutations
- [SQL Relay文档] SQL Relay中PHP API参考手册 (英文)
- EJB整合JSF简单的小例子
- storm 原理简介及单机版安装指南
- HTTP客户端向其他网站请求数据
- C++中局部静态变量的调用问题
- 网易云音乐可爱的tabbar
- Mutations #Facebook Relay文档翻译#
- hdu5468(容斥原理)-2015 ACM/ICPC Asia Regional Shanghai Online
- 巧用onWindowFocusChanged(boolean hasFocus)
- 日志Human Resource Evaluation
- Storm实时计算:流操作入门编程实践
- 十道海量数据处理面试题
- 内存泄露与野指针
- spring进阶二
- 导出excel功能(解决大数据量问题)