APIchat 02: GraphQL vs REST APIs

preview_player
Показать описание
Hitch Co-founders Luke Miller and Bruno Pedro discuss GraphQL vs REST APIs in #APIchat 02.

• Previous Video - #APIchat 01: What's new in the API world for 2017 -

Рекомендации по теме
Комментарии
Автор

GraphQL
1. I usually achieve a sensitive information hiding by making authorization process per request (on this single endpoint) and then defining which fields should be hidden for unauthorized user. They can still see that there are those fields but it's like "I know you have a pin code on your credit card but what do I have from it if I don't know the actual pin". Somebody solves it by merging a schema authorized users for newly authorized users (this solves the problem that I don't even know if you have pin on your credit card)

2. I do versioning when I put one graphql schema on route api/v1 and the other on api/v2 (both can use the same base models/services)

3. Everything can be privately cached (there are libraries and extensions for GraphQL to make caching although it's not classical HTTP caching). The only problem is shared caching which is not a problem of GraphQL specification but because it's very young technology which leads to lack of usage yet.

I must point out a simple idea: GraphQL as well as RESTful are both just a specifications of server-client communication (data transport). The problems which you are proposing are just details which can be solved by a proper implementation.

jurajcarnogursky
welcome to shbcf.ru