GraphQL是API的未來,但它並非銀彈

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我認爲,GraphQL將改變世界。將來,你可以使用GraphQL查詢世界上的任何系統。我在創造這樣的未來。那麼我爲什麼要對使用GraphQL進行辯駁呢?我個人最討厭的是,社區一直在宣傳GraphQL的好處,而這些好處卻非常普通,並且與GraphQL實際上沒有任何關係。如果我們想推廣採用,那麼我們應該誠實,應該摘掉有色眼鏡。這篇文章是對Kyle Schrade的文章“"},{"type":"link","attrs":{"href":"https:\/\/www.apollographql.com\/blog\/why-use graphql\/","title":"","type":null},"content":[{"type":"text","text":"爲什麼使用GraphQL"}]},{"type":"text","text":"”的迴應。這並不是批評。這篇文章是一個很好的討論基礎,因爲它代表了我在社區中經常聽到的觀點。如果你讀了整篇文章,當然這會花一些時間,你就會完全理解,爲什麼我認爲Kyle的文章應該改名爲“爲什麼使用Apollo”。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果你還沒有讀過Kyles的文章,我建議你先讀一下。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"本文最初發佈於WunderGraph官方博客(《"},{"type":"link","attrs":{"href":"https:\/\/wundergraph.com\/blog\/why_not_use_graphql","title":"","type":null},"content":[{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"Why not use GraphQL?"}]},{"type":"text","marks":[{"type":"italic"},{"type":"strong"}],"text":"》),經原作者授權由InfoQ中文站翻譯並分享。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"REST的缺點"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"作者指出了REST API的一系列缺點,以及GraphQL如何克服所有這些缺點:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"過度獲取;"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"多個請求請求多項資源;"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"針對嵌套數據的瀑布式網絡請求;"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"每個客戶端都需要知道每個服務的位置。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章