Relay和Graphql是否为RESTful? [英] Are Relay and 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屋!