Relay 和 Graphql 是 RESTful 吗? [英] Are Relay and Graphql RESTful?

查看:13
本文介绍了Relay 和 Graphql 是 RESTful 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管 Graphql API 和使用 HTTP 实现的常见 REST API 之间存在许多差异,但我想知道这些差异是语法上的还是 Relay 和 Graphql 根本上是非 RESTful 的.如果是这样,他们违反了 REST 的哪些约束?

Although there are many differences between Graphql APIs and common REST APIs implemented with HTTP, I am wondering if these differences are syntactical or if Relay and Graphql are fundamentally non-RESTful. If so which constraint of REST do they violate?

推荐答案

GraphQL 不是 RESTful,因为它不使用 uris 和 http 方法来表达操作的性质.你有一个路由(例如:/graphql),你将所有操作发送到 - 查询和突变,对所有类型的实体.

GraphQL is not RESTful as it doesn't use uris and http methods to express the nature of the operations. You have one route (for example: /graphql) that you send all operations to - both queries and mutations, on all types of entities.

这篇关于Relay 和 Graphql 是 RESTful 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆