它们是三种操作类型(operation types),各自映射到 schema 中的一个根类型:
- Query —— 读取数据。字段并行运行,且不能有副作用(类似 HTTP GET)。
- Mutation —— 写入数据(创建/更新/删除)。顶层字段顺序运行,因此顺序有保证。
- Subscription —— 一个长连接的流:每当有事件触发,服务器就通过 WebSocket 之类的传输层把新数据推送给客户端。
graphql
GetPost
post title
AddComment
addComment ,
id
text
OnComment
commentAdded
id
text
