{"id":317991,"date":"2021-02-05T01:29:32","date_gmt":"2021-02-04T17:29:32","guid":{"rendered":"http:\/\/4563.org\/?p=317991"},"modified":"2021-02-05T01:29:32","modified_gmt":"2021-02-04T17:29:32","slug":"%e6%9c%89%e7%94%a8%e8%bf%87-graphql-%e7%9a%84%e5%90%97%ef%bc%9f%e5%8f%af%e4%bb%a5%e8%bf%9b%e6%9d%a5%e8%af%b4%e8%af%b4%e7%9b%b8%e6%af%94-restful-%e7%9a%84%e4%bc%98%e5%8a%a3%e5%90%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=317991","title":{"rendered":"\u6709\u7528\u8fc7 GraphQL \u7684\u5417\uff1f\u53ef\u4ee5\u8fdb\u6765\u8bf4\u8bf4\u76f8\u6bd4 restful \u7684\u4f18\u52a3\u5417?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709\u7528\u8fc7 GraphQL \u7684\u5417\uff1f\u53ef\u4ee5\u8fdb\u6765\u8bf4\u8bf4\u76f8\u6bd4 restful \u7684\u4f18\u52a3\u5417?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ReinerShir <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u5728\u4f7f\u7528 restful \u4e2d\uff0c\u7ecf\u5e38\u53d1\u73b0\u65e0\u6cd5\u4e25\u683c\u6309\u7167 restful \u89c4\u8303\u6765\u8bbe\u8ba1\uff0c\u7ed3\u679c\u5c31\u662f\u6162\u6162\u7684\u53d8\u6210\u7684\u4e00\u4e2a\u4ec5\u4ec5\u662f\u770b\u8d77\u6765\u50cf\u662f restful \u7684\u8bbe\u8ba1<\/p>\n<p>\u56e0\u6b64\u7f51\u4e0a\u627e\u8d44\u6599\u53d1\u73b0\u4e86 GraphQL\uff0c<strong>\u5b83\u53ef\u4ee5\u5927\u91cf\u8282\u7701\u8bf7\u6c42\u6b21\u6570\uff0c\u8fd4\u56de\u5b57\u6bb5\u7531\u524d\u7aef\u51b3\u5b9a\uff0c\u4e5f\u4e0d\u7528\u5199\u6587\u6863\u4e86<\/strong>\uff0c\u521d\u6b65\u4e86\u89e3\u4e4b\u4e0b\u611f\u89c9\u5f88\u4e0d\u9519\u3002<\/p>\n<p>\u4f46\u8f6c\u5ff5\u4e00\u60f3\u53ef\u80fd\u6ca1\u8fd9\u4e48\u7b80\u5355\uff0c\u6709\u6ca1\u6709\u7528\u8fc7\u7684\u5927\u4f6c\u6765\u8bf4\u8bf4\u5b83\u6709\u4ec0\u4e48\u5751\uff1f<\/p>\n<p>\u76f8\u6bd4 restful \u7684\u4f18\u52a3\u6709\u54ea\u4e9b\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>50<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5101752\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : baiyi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             graphQL \u662f\u7ed9 API \u8bbe\u8ba1\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u5e94\u8be5\u5c5e\u4e8e\u7279\u6b8a\u573a\u666f\uff08\u8d44\u6e90\u6709\u7740\u8f83\u591a\u590d\u6742\u67e5\u8be2\uff09\u9002\u7528\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101753\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jingcoco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u81ea\u5b66\u4e86\u4e00\u6bb5\u65f6\u95f4,\u524d\u6bb5\u65f6\u95f4\u770b\u5e16\u5b50\u8bf4\u70ed\u5ea6\u964d\u4e86\u4e0b\u6765,\u8bf4\u662f\u524d\u7aef\u540c\u5b66\u7528\u7684\u723d,\u4f46\u662f\u540e\u7aef\u7684\u540c\u5b66\u4e0d\u613f\u610f\u505a. \u4e0d\u8fc7\u6211\u4e2a\u4eba\u611f\u89c9\u8fd8\u662f\u60f3\u7ee7\u7eed\u5b66\u4e60.\u7136\u540e\u540e\u7aef\u9009\u4e00\u4e2a express \u6846\u67b6\u7684.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101754\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jingcoco <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e2a\u4eba\u6ca1\u6709\u592a\u61c2\u90a3\u4e2a\u5e16\u5b50\u7684\u90a3\u4e2a\u8a00\u8bba,\u4e3a\u5565\u540e\u7aef\u8fd9\u4e48\u62b5\u89e6&#8230;.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101755\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : co1mugx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8c03\u7528\u7aef\u662f\u723d\u4e86\uff0c\u4f46\u662f\u670d\u52a1\u7aef\u9664\u4e86\u5199\u63a5\u53e3\u8fd8\u5f97\u5199\u63cf\u8ff0\uff0c\u4e0d\u7136\u600e\u4e48\u516c\u5e03\u53ef\u4ee5\u83b7\u53d6\u54ea\u4e9b\u5b57\u6bb5\u3002\u6240\u4ee5\u5e76\u4e0d\u80fd\u8bf4\u524d\u7aef\u8981\u4ec0\u4e48\u53ef\u4ee5\u81ea\u5df1\u51b3\u5b9a\uff0c\u4ed6\u8981\u4f60\u4e5f\u5f97\u6709\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101756\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : avastms <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Restful \u5df2\u7ecf\u662f\u8fc7\u5ea6\u5ba3\u4f20\u5b9e\u9645\u610f\u4e49\u4e0d\u5927\u7684\u4e1c\u897f\u4e86\uff0cGraphQL \u6839\u672c\u5c31\u662f\u8fd9\u79cd xjb \u5ba3\u4f20\u8d34\u5927\u5b57\u62a5\u884c\u4e3a\u7684\u65e0\u654c\u5a01\u529b\u52a0\u5f3a\u7248\u3002<\/p>\n<p>\u53ea\u6709\u4e00\u79cd\u60c5\u51b5 GraphQL \u6709\u7528\uff1a<br \/>\u5f53\u4f60\u60f3\u628a SQL \u6570\u636e\u5e93\u67e5\u8be2\u5de5\u4f5c\u91cf\u524d\u7f6e\u5230\u6d4f\u89c8\u5668\u7684\u65f6\u5019\u3002<\/p>\n<p>\u4efb\u4f55\u5176\u4ed6\u60c5\u51b5\u90fd\u4e0d\u9002\u7528\uff0c \u4efb\u4f55\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684\u5e94\u7528\u662f\u7528\u7684 MongoDB \u6216\u8005\u4efb\u4f55\u4e0d\u662f SQL \u7684\uff0c\u7b49\u7740\u96be\u53d7\u5427\uff0c\u6076\u5fc3\u6b7b\u4f60\u3002<br \/>\u5982\u679c\u4f60\u7684\u5e94\u7528\u662f\u9ad8\u5ea6\u52a8\u6001\u7684\uff0c\u7b49\u7740\u96be\u53d7\u5427\uff0c\u6076\u5fc3\u6b7b\u4f60\u3002<br \/>\u5982\u679c\u4f60\u7684\u5e94\u7528\u662f\u6709\u5206\u9875\u6982\u5ff5\u800c\u4e0d\u662f\u76f4\u63a5\u67e5\u6570\u636e\u5e93\u7684\uff0c\u7b49\u7740\u96be\u53d7\u5427\uff0c\u6076\u5fc3\u6b7b\u4f60\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684\u5e94\u7528\u662f\u4f60\u81ea\u5df1\u8bbe\u8ba1\u7684\u6709\u81ea\u5df1\u7684\u60f3\u6cd5\u4f1a\u601d\u8003\uff0c\u800c\u4e0d\u662f\u6309\u7167\u4e2b\u633a\u7684\u6559\u7a0b c-c c-v\uff0c\u7b49\u7740\u96be\u53d7\u5427\uff0c\u6076\u5fc3\u6b7b\u4f60                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101757\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : co1mugx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e4b\u524d\u7528 nestjs \u7684\u65f6\u5019\u4f46\u662f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u65b9\u6848\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7801\u751f\u6210 gql \u6587\u4ef6\uff0c\u5176\u4ed6\u6846\u67b6\u5e94\u8be5\u4e5f\u6709\u7c7b\u4f3c\u64cd\u4f5c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101758\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : atonku <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u51fa\u4efb\u4f60\u51fa\uff0c\u6211\u7528\u7b97\u6211\u8f93\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101759\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : adjusted <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4eec\u7528 graphql schema \u751f\u6210\u5bf9\u5e94\u7684 go struct\uff0c\u5199\u8d77\u6765\u5f88\u8212\u670d\u3002GraphQL \u521d\u770b\u662f\u4e00\u79cd\u81ea\u5b9a\u4e49\u67e5\u8be2\u7684\u534f\u8bae\uff0c\u5176\u5b9e\u6211\u8ba4\u4e3a\u66f4\u91cd\u8981\u7684\u662f\u7c7b\u578b\uff0c\u4ee3\u8868\u7740 API \u5f00\u53d1\u5411 schema driven \u548c\u7c7b\u578b\u7684\u8f6c\u53d8\uff0c\u5176\u5b9e\u633a\u7b26\u5408 javascript \u5411 typescript \u8f6c\u53d8\u7684\u503e\u5411\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101760\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : FantaMole <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u6709\u5b9e\u9645\u4e1a\u52a1\u63a5\u53e3\u771f\u7684\u4f1a\u4e25\u683c\u6309 restful \u7684\u6807\u51c6\u6765\u6267\u884c\u7684\uff0c\u6ee1\u8db3\u4e0d\u4e86\u4e1a\u52a1\u8981\u6c42\u3002\u5b83\u662f\u4e00\u4efd\u6807\u51c6\uff0c\u4f60\u53ef\u4ee5\u7528\u6765\u53c2\u8003\uff0c\u4f46\u4e0d\u662f\u4ec0\u4e48\u90fd\u8981\u6309\u8fd9\u4e0a\u9762\u6765\u505a\u3002\u800c\u4e14\u8bf4\u53e5\u5b9e\u8bdd\uff0c\u4f60\u4f1a\u53d1\u73b0\u540c\u4e00\u4e2a\u516c\u53f8\u7684\u540c\u4e8b\u82f1\u8bed\u6c34\u5e73\u771f\u662f\u53c2\u5dee\u4e0d\u9f50\uff0c\u5c31\u8bf4 restful \u7684 api \u8def\u5f84\u547d\u540d\uff0c\u4e0d\u7528\u52a8\u8bcd\u5c31\u8981\u618b\u6b7b\u4e00\u6279\u4eba\uff0c\u8be5\u4e0d\u8be5\u7528\u590d\u6570\uff0c\u53c8\u8981\u618b\u6b7b\u4e00\u6279\u4eba                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101761\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wdhwg001 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u770b\u597d\uff0c\u56e0\u4e3a\u8bf7\u6c42\u5408\u5e76\u4e86\u5c31\u610f\u5473\u7740\u65e0\u6cd5\u533a\u5206\u4e3b\u6b21\uff0c\u670d\u52a1\u5668\u7aef\u4e5f\u9700\u8981\u4e00\u53e3\u6c14\u51c6\u5907\u6240\u6709\u6570\u636e\uff0c\u8fd9\u6837\u4f20\u8f93\u7684\u5e76\u884c\u8fd8\u662f\u67e5\u8be2\u7684\u5e76\u884c\u90fd\u66f4\u96be\u5b9e\u73b0\u3002<br \/>\u66f4\u4e0d\u7528\u8bf4\uff0c\u5f88\u591a\u65f6\u5019\u670d\u52a1\u5668\u7aef\u662f\u9700\u8981\u5bf9\u7279\u5b9a\u7684 crud \u505a\u4f18\u5316\u7684\uff0c\u9700\u6c42\u653e\u8fd9\u4e48\u5f00\u7684\u8bdd\u8fd9\u79cd\u4f18\u5316\u4e5f\u66f4\u56f0\u96be\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101762\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zjsxwc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e2a\u4eba\u89c9\u5f97 GraphQL \u4e0e\u51e0\u5341\u5e74\u524d\u7684 CS \u67b6\u6784\u7684\u8f6f\u4ef6\u6ca1\u4ec0\u4e48\u4e0d\u540c\uff0c<\/p>\n<p>CS \u65f6\u4ee3\u540e\u7aef\u76f4\u63a5\u5199\u6570\u636e\u5e93\u5b58\u50a8\u8fc7\u7a0b\uff0c\u5ba2\u6237\u7aef\u76f4\u63a5\u7528 SQL\uff0c\u6743\u9650\u63a7\u5236\u5728 DB \u91cc\u914d\u7f6e\uff0c<\/p>\n<p>\u5386\u53f2\u603b\u662f\u60ca\u4eba\u7684\u76f8\u4f3c\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101763\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : KuroNekoFan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u4f60\u6709\u5f88\u539f\u5b50\u7684 restful \u540e\u7aef\uff0cgraphql \u7684\u610f\u4e49\u5728\u4e8e\u51cf\u5c11\u6570\u636e\u4f20\u8f93\u7684\u5197\u4f59                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101764\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mahone3297 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6700\u8fd1\u770b\u5230\u4e00\u7bc7\u6587\u7ae0\uff0c\u5bf9\u6bd4\u4e86 graphQL \u548c restful \u533a\u522b\uff0c\u53ef\u4ee5\u53c2\u8003\u4e0b<br \/>https:\/\/mp.weixin.qq.com\/s?__biz=MzA3MDIyNTgzNA==&amp;mid=2649974959&amp;idx=1&amp;sn=e91c177840276c4cd93c0482ad1d4c81&amp;chksm=86c7d26ab1b05b7c6bfce96b3adaba7254512de86dd53fa36152734bedcacd112ea2f34b3394&amp;token=43242864&amp;lang=zh_CN#rd                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101765\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : forgottencoast <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @FantaMole \u201c\u8be5\u4e0d\u8be5\u7528\u590d\u6570\u201d \u7b11\u4e86\uff0c\u771f\u7684\uff0c\u53ea\u80fd\u9760\u5168\u516c\u53f8\u7edf\u4e00\u89c4\u8303\u6765\u89e3\u51b3\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101766\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : bsg1992 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             GraphQL \u548c restful \u573a\u666f\u7279\u522b\u7279\u522b\u7684\u5c0f\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101767\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : masterclock <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e2a\u4eba\u4f7f\u7528 GraphQL \u7684\u4e3b\u8981\u539f\u56e0\u662f\u5f3a\u7c7b\u578b\u3002<br \/>React + TypeScript \u4e0b\u7528 introspection \u51fa\u6765\u7684 schema \u548c gql tag \u91cc\u7684\u67e5\u8be2\u8bed\u53e5\u9884\u7f16\u8bd1\u751f\u6210 react \u7684 hook\uff0c\u4fdd\u8bc1\u7f16\u8bd1\u80fd\u8fc7\u3002<br \/>\u670d\u52a1\u7aef\u7528 apollo \u7684 gateway \u505a federation\uff0c \u7ec4\u5408\u591a\u4e2a GraphQL \u7684\u540e\u7aef\uff0c\u51e0\u4e2a\u540e\u7aef\u7684\u534f\u8c03\u4e00\u4e0b\u547d\u540d\u7b49\uff0c\u76f8\u4e92\u95f4\u8bbf\u95ee\u548c\u9694\u79bb\u95ee\u9898\u90fd\u4e0d\u5927\u3002<br \/>GraphQL \u7528\u6765\u63d0\u4f9b \u201cone api\u201d\uff0c\u8ddf SQL \u4ec0\u4e48\u7684\u90fd\u6ca1\u4ec0\u4e48\u5173\u7cfb\uff0cGraphQL \u4e5f\u4e0d\u662f SQL \u7684\u6709\u6548\u62bd\u8c61\u3002<br \/>\u7528\u4ec0\u4e48\u6570\u636e\u5e93\u4e5f\u65e0\u6240\u8c13\uff0c\u53cd\u6b63\u90fd\u5728 resolver \u91cc\u89e3\u51b3\u3002<br \/>\u9ad8\u5ea6\u52a8\u6001\u786e\u5b9e\u4e0d\u592a\u597d\uff0c\u76f4\u63a5\u53d8\u6210 AnyQL\uff0c\u7c7b\u578b\u610f\u4e49\u5168\u6ca1\u4e86\u3002<br \/>\u5206\u9875\u7528 Relay \u5b9a\u4e49\uff0c\u652f\u6301 cursor \u6216 offset\uff0c\u5b9e\u73b0\u8d77\u6765\u6bd4\u8f83\u9ebb\u70e6\uff0c\u4f46\u5ba2\u6237\u7aef\u4e0a\u597d\u7528\u70b9\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101768\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ReinerShir <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @forgottencoast \u60f3\u95ee\u4e0b\u67e5\u8be2\u53c2\u6570\u5f88\u591a\u7684\u60c5\u51b5\u4e0b\u4f60\u4eec\u662f\u600e\u4e48\u89e3\u51b3\u7684\uff1f restful \u89c4\u5b9a\u67e5\u8be2\u4f7f\u7528 get\uff0c\u53c2\u6570\u62fc url \u540e\u9762\uff0c\u4f46\u662f\u53c2\u6570\u4e00\u591a\uff0c\u90a3\u4e2a\u53c2\u6570\u680f\u60e8\u4e0d\u5fcd\u7779\uff0c\u53d6\u503c\u3001\u7ef4\u62a4\u90fd\u5f88\u9ebb\u70e6\uff0c\u6240\u4ee5\u6211\u4eec\u662f\u76f4\u63a5\u67e5\u8be2\u7528 POST \u3001\u53c2\u6570\u653e BODY \u91cc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101769\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : coolair <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6743\u9650\u4e0d\u597d\u63a7\u5236                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101770\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 676529483 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u4f60\u7684\u63a5\u53e3\u9700\u8981\u95e8\u6846\u6a21\u5f0f\uff08\u4e5f\u5c31\u662f\u7ecf\u5e38\u9700\u8981\u628a\u51e0\u4e2a\u63a5\u53e3\u6574\u5408\u8d77\u6765\uff0c\u51cf\u5c11\u8c03\u7528\u6b21\u6570\uff09\uff0cGraphQL \u5f88\u8d5e\u3002\u5f53\u7136\u8fd9\u662f\u524d\u7aef\uff0c\u540e\u7aef\u4e0d\u4f1a\u51cf\u5c11\u4ee3\u7801\u91cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101771\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : bruceshi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1. GraphQL\uff0c\u4ee3\u7801\u751f\u6210\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\uff0c\u4e0d\u8bba\u662f code first \u8fd8\u662f schema first\uff0c\u8981\u4e0d\u7136\u4f1a\u5f88\u9ebb\u70e6\uff0c\u9009\u62e9\u4e00\u4e2a\u597d\u7684\u5de5\u5177\uff08\u6846\u67b6\uff09\u5f88\u91cd\u8981\uff0c\u6709\u5174\u8da3\u7684\u540c\u5b66\u53ef\u4ee5\u770b\u4e0b[NestJs]( https:\/\/docs.nestjs.com\/graphql)\u7684\u4e00\u4e9b\u5b9e\u73b0<br \/>2. GraphQL \u662f API \u67e5\u8be2\u8bed\u8a00\u4e0d\u7b49\u4e8e GraphQL \u76f4\u63a5\u67e5\u8be2\u6570\u636e\u5e93<br \/>3. GraphQL \u53ea\u662f\u4e00\u79cd\u65b0\u7684\u7ec4\u7ec7 API \u67e5\u8be2\u65b9\u5f0f\u548c\u7ed3\u6784\u7684\u5de5\u5177\uff0c\u672c\u8d28\u4e0a\u8fd8\u662f HTTP<br \/>4. \u8bf4 MongoDB \u7684\uff0c\u6211\u89c9\u5f97\u4e0d\u8bba\u662f Restful \u8fd8\u662f GraphQL \u6211\u90fd\u4f1a\u6b7b\uff0cGraphQL \u548c\u4f60\u7528\u4ec0\u4e48 DB \u6ca1\u6709\u672c\u8d28\u4e0a\u7684\u5173\u7cfb<br \/>5. GraphQL \u4e5f\u53ef\u4ee5\u5f88\u7b80\u5355\u7684\u5206\u9875\uff0c\u5982\u679c\u89c9\u5f97\u5206\u9875\u6709\u95ee\u9898\u7684\uff0c\u6211\u76f8\u4fe1\u662f\u770b\u5230\u7f51\u4e0a\u5f88\u591a\u4f7f\u7528 [Relay]( https:\/\/relay.dev\/docs\/en\/graphql-server-specification.html#connections) \u63d0\u5230\u7684\u5206\u9875\u65b9\u5f0f\uff0c\u4ee3\u7801\u5728\u81ea\u5df1\u624b\u91cc\uff0c\u60f3\u5199\u7b80\u5355\u5c31\u5199\u7b80\u5355\u70b9\u3002<br \/>6. \u6743\u9650\u63a7\u5236\u7684\u8bdd\uff0c\u53ef\u4ee5\u7cbe\u786e\u5230 field level\uff0c\u4e0d\u77e5\u9053\u5927\u5bb6\u63d0\u5230\u7684\u6743\u9650\u95ee\u9898\u5177\u4f53\u662f\u4ec0\u4e48\uff0c\u6211\u6682\u65f6\u6ca1\u9047\u5230\u5f88\u590d\u6742\u7684\u6743\u9650\u63a7\u5236\uff0c\u6ca1\u6709\u4ec0\u4e48\u53d1\u8a00\u6743\u3002<br \/>7. \u590d\u6742\u5ea6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49 complexity \u63a7\u5236\u3002<br \/>8. \u7f13\u5b58\u95ee\u9898\uff0cpayload \u5927\u7684\u95ee\u9898\uff0cGraphQL \u53ef\u4ee5\u901a\u8fc7[persisted queries]( https:\/\/www.apollographql.com\/docs\/apollo-server\/performance\/apq\/)\u5c06 POST \u53d8\u6210 GET<br \/>9. \u591a\u5b66\u4e60\uff0c\u591a\u601d\u8003\uff0c\u800c\u4e0d\u662f\u65e0\u8111\u9ed1\u4e00\u4e2a\u5938\u4e00\u4e2a\u3002\u518d\u9ed1\u7684\u4e1c\u897f\u4e5f\u6709\u95ea\u5149\u70b9\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101772\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wwwap <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             debug \u633a\u9ebb\u70e6\u7684, \u5f00\u53d1\u8005\u5de5\u5177\u91cc\u5168\u662f \/api\/graphql \u7684\u8bf7\u6c42\uff0c\u53ea\u6709\u70b9\u5f00\u770b request \u548c response \u624d\u80fd\u641e\u6e05\u8c01\u662f\u8c01\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101773\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dk7952638 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             graphql \u723d\u4e0d\u723d\u4e3b\u8981\u770b\u4e24\u70b9\uff0c<br \/>\u4e00\u662f\u8c03\u7528\u7aef\u613f\u4e0d\u613f\u610f\u63a5\u53d7\uff0c\u867d\u7136\u5f88\u7b80\u5355\uff0c\u4f53\u9a8c\u5f88\u597d\uff0c\u4f46\u662f\u603b\u6709\u4e00\u7fa4\u4eba\uff0c\u5b66\u4e60\u4e2a\u65b0\u4e1c\u897f\u6bd4\u6740\u4e86\u4ed6\u4eec\u8fd8\u96be\uff0c<br \/>\u7b2c\u4e8c\u662f\u540e\u7aef\u5b9e\u73b0\u4e00\u4e2a\u5b8c\u6574\u7684 graphql \u670d\u52a1\u5176\u5b9e\u590d\u6742\u5ea6\u5f88\u9ad8\uff0c\u505a\u7f13\u5b58\u4e5f\u6bd4\u8f83\u96be\uff0c\u5bf9\u540e\u7aef\u56e2\u961f\u7684\u6280\u672f\u8981\u6c42\u5f88\u9ad8\uff0c\u9519\u8bef\u7684\u5b9e\u73b0\u65b9\u5f0f\u53cd\u800c\u4f1a\u8ba9\u95ee\u9898\u66f4\u590d\u6742\uff0c<br \/>\u53e6\u5916\u8fd8\u6709\u4e00\u70b9\uff0cgraphql \u7684\u751f\u6001\u6bd4\u8f83\u5b8c\u5584\u7684\u662f node\uff0c\u800c\u56fd\u60c5\u76ee\u524d\u8fd8\u662f java \u5929\u4e0b\uff0c<br \/>\u7efc\u4e0a\u6240\u8ff0\uff0c\u8fd9\u4e1c\u897f\u5728\u5df2\u7ecf\u6709\u81ea\u5df1\u7684\u6280\u672f\u6808\u6216\u8005\u6743\u529b\u6bd4\u8f83\u5206\u6563\u7684\u5927\u516c\u53f8\u6bd4\u8f83\u96be\u63a8\uff0c\u5c0f\u516c\u53f8\u5c0f\u56e2\u961f\u53ef\u4ee5\u8bd5\u8bd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101774\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : linoder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             graphql \u9002\u5408\u4f01\u4e1a\u7ea7\u540e\u53f0 \u522b\u7684\u573a\u666f\u771f\u4e0d\u9002\u5408 \u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101775\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : KIMMG <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4ece restful \u8fc7\u6e21\u5230\u4e86 graphQL \u3002<\/p>\n<p>\u8fd9\u91cc\u8bf4\u8bf4\u611f\u53d7\uff0crestful \u5b9e\u9645\u4e0a\u662f\u4e00\u79cd\u7ea6\u675f\uff0c\u5b83\u7ea6\u675f API \u8bbe\u8ba1\u5e94\u8be5\u9075\u5faa\u8d44\u6e90\u89c4\u8303\u3002\u7528\u6237\u8d44\u6e90\u548c\u8ba2\u5355\u8d44\u6e90\u662f\u5206\u5f00\u7684\u3002<br \/>\u4f46\u8fd9\u79cd\u8bbe\u8ba1\u662f\u65b9\u4fbf\u540e\u7aef\u7684\uff0c\u6309\u7167\u8fd9\u79cd\u8bbe\u8ba1\uff0c\u7531\u4e8e\u4e1a\u52a1\u7684\u7ec4\u5408\uff0c\u524d\u7aef\u9700\u8981\u591a\u6b21\u53d1\u8d77\u8c03\u7528\u4e0d\u540c\u8d44\u6e90\u7684 api\uff0c\u5c31\u5f88\u7e41\u7410\u4e86\u3002<br \/>\u5b9e\u9645\u4e1a\u52a1\u4e2d\u5f88\u96be\u4e25\u683c\u9075\u5b88\u8fd9\u79cd\u89c4\u8303\uff0c\u5bfc\u81f4 \/users\/{id}\/orders\/{id} \u8fd9\u79cd\u60c5\u51b5\u7ecf\u5e38\u51fa\u73b0\u3002<br \/>\u751a\u81f3 \/users\/getUser \u8fd9\u79cd\u5b8c\u5168\u4e0d\u662f restful \u98ce\u683c\u7684 api \u7684\u51fa\u73b0\u3002<\/p>\n<p>\u800c graphQL \u7684\u7ed3\u6784\u58f0\u660e\uff0c\u5176\u5b9e\u4e5f\u662f restful \u601d\u7ef4\u7684\u6269\u5c55\u3002<\/p>\n<p>\u73b0\u5b9e\u662f\uff0capi \u7684\u8bbe\u8ba1\u8fc7\u4e8e\u968f\u610f\uff0cgraphQL \u4e2d\u7ed3\u6784\u7684\u58f0\u660e\u4e5f\u5f88\u5c11\u9075\u4ece\u8bbe\u8ba1\u539f\u5219\u3002\u4f9d\u65e7\u662f\u5bfc\u81f4\u8d44\u6e90\u5d4c\u5957\u5f88\u6df1\u3002<br \/>\u5230\u5934\u6765\u5199\u7684\u4e8c\u4e0d\u50cf\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101776\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binux <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             aip.dev                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101777\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuanbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             graphQL \u6ca1\u6709\u89e3\u51b3\u4efb\u4f55\u95ee\u9898\uff0c\u53cd\u800c\u589e\u52a0\u4e86\u7cfb\u7edf\u7684\u590d\u6742\u5ea6\u3002\u524d\u7aef\u53d1\u660e\u7684\u4e1c\u897f\u7ecf\u5e38\u5982\u6b64\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101778\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : keepeye <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u53ea\u8981\u5bf9\u6574\u4f53\u6709\u5229\uff0c\u90a3\u5c31\u503c\u5f97\uff0c\u4e0d\u80fd\u5149\u8003\u8651\u524d\u7aef\u8c03\u7528\u65b9\u4fbf\u800c\u5ffd\u89c6\u540e\u7aef\u7684\u96be\u5ea6\u589e\u52a0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101779\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : janxin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             GraphQL \u548c\u56fe\u7684\u5173\u7cfb\u4e86\u89e3\u4e00\u4e0b\uff0c\u6240\u4ee5\u53ef\u4ee5\u5efa\u6a21\u4e3a\u56fe\u5173\u7cfb\u7684\u90fd\u53ef\u4ee5\u7528<\/p>\n<p>\u4e0d\u8fc7\u95ee\u9898\u662f\u7531\u4e8e\u8026\u5408\u5f88\u5927\uff0c\u6240\u4ee5\u4f1a\u5bfc\u81f4\u4f18\u5316\u8d77\u6765\u96be\u5ea6\u8fdc\u6bd4 Restful \u65b9\u6848\u66f4\u9ebb\u70e6                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101780\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nigelvon <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528\u4e86 3 \u5e74\u591a\u4e86\uff0c\u73b0\u5728\u5185\u90e8\u9879\u76ee\u5168\u90e8\u4e0a GraphQL\uff0c\u7248\u672c\u8fed\u4ee3\u901f\u5ea6\u5feb\u4e86\u5f88\u591a\u3002\u63a5\u53e3\u6027\u80fd\u4e5f\u6709\u5927\u5e45\u4e0a\u5347\u3002\u5e95\u5c42\u5fae\u670d\u52a1\u63d0\u4f9b\u7c92\u5ea6\u5f88\u5c0f\u7684 API\uff0c\u65b9\u4fbf\u505a\u7f13\u5b58\uff0c\u4e2d\u95f4\u5c42\u7528 GraphQL \u7ec4\u88c5\u6570\u636e\uff0c\u524d\u7aef\u6309\u9700\u8c03\u7528\uff0c\u723d\u5f97\u98de\u8d77\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101781\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Desiree <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xuanbg \u4f60\u7528\u8fc7\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101782\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ReinerShir <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nigelvon \u6211\u660e\u767d\u4e86\uff0c\u4f60\u7684\u67b6\u6784\u662f\u4f4e\u5c42\u670d\u52a1\u8bbf\u95ee\u6570\u636e\u5e93\uff0capi \u8d70 restful\uff0c\u975e\u5e38\u5206\u6563\u7684\u90a3\u79cd\uff0c\u4e2d\u95f4\u5c42\u505a\u4e1a\u52a1\u903b\u8f91\uff0c\u8d1f\u8d23\u63a5\u6536\u524d\u7aef\u8bf7\u6c42\u7136\u540e\u8c03\u7528\u4f4e\u5c42\u670d\u52a1\uff0c\u4f46\u662f\u8fd9\u6837\u5176\u5b9e\u8fd8\u662f\u591a\u6b21\u8c03\u7528\uff0c\u53ea\u4e0d\u8fc7\u4e2d\u95f4\u5c42\u628a\u5b83\u5c01\u95ed\u4e86\u800c\u5df2\uff0c\u4e0d\u77e5\u9053\u6211\u7406\u89e3\u5f97\u5bf9\u4e0d\u5bf9\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101783\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : beichenhpy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8981\u524d\u7aef\u53c2\u4e0e\u4e1a\u52a1\u8bbe\u8ba1\uff0c\u76f8\u5f53\u4e8e\u540e\u7aef\u4e00\u4e2a\u5927\u63a5\u53e3\uff0c\u5230 GraphQL \u6309\u9700\u9009\u53d6\u6570\u636e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101784\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jsq2627 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd1 1 \u5e74\u90fd\u5728\u548c GraphQL \u6253\u4ea4\u9053\uff0c\u63a5\u89e6\u7684\u65b9\u9762\u5305\u62ec\uff1a<br \/>1. \u524d\u7aef apollo client \u548c\u540e\u7aef node.js apollo server \u6253\u4ea4\u9053\uff0c\u540e\u7aef\u662f\u91cd\u4e1a\u52a1\u4ee3\u7801<br \/>2. \u524d\u7aef apollo client \u548c\u540e\u7aef graphql ruby \u6253\u4ea4\u9053\uff0c\u540e\u7aef\u4e5f\u662f\u91cd\u4e1a\u52a1\u4ee3\u7801<br \/>3. \u524d\u7aef react query \u548c\u540e\u7aef node.js apollo server \u6253\u4ea4\u9053\uff0c\u540e\u7aef\u662f BFF \u5c42<\/p>\n<p>\u603b\u7ed3\u4e00\u4e0b\u4e2a\u4eba\u5bf9 GraphQL \u8bc4\u4ef7<br \/>\u4f18\u70b9\uff1a<br \/>&#8211; schema-driven \u7684\u5f00\u53d1\u6d41\u7a0b\uff0c\u884d\u751f\u51fa\u4e00\u7cfb\u5217\u597d\u5904\uff1a\u4ee3\u7801\u751f\u6210\u3001\u7cbe\u786e\u7684\u63a5\u53e3\u6587\u6863\u3002\u7c7b\u6bd4 RESTful \u7684 swagger \u3002<br \/>&#8211; \u5f88\u5bb9\u6613\u5b9e\u73b0 field \u7c92\u5ea6\u7684 ACL<br \/>&#8211; \u826f\u597d\u7684\u7c7b\u578b\u7cfb\u7edf\uff0c\u5bf9 normalization \u3001cache \u3001codegen \u7b49\u90fd\u975e\u5e38\u53cb\u597d<br \/>&#8211; \u6709\u5b98\u65b9 spec\uff0c\u4e0d\u50cf RESTful \u6709\u5404\u79cd\u4e0d\u540c\u7684\u89e3\u8bfb\u65b9\u5f0f\uff08\u5c3d\u7ba1 spec \u6ca1\u6709\u63d0\u5230\u5206\u9875\uff0c\u4f46 relay style \u5df2\u7ecf\u6210\u4e3a\u4e86\u4e8b\u5b9e\u6807\u51c6\uff09<\/p>\n<p>\u7f3a\u70b9\uff1a<br \/>&#8211; \u5404\u7c7b HTTP debug \u5de5\u5177\u652f\u6301\u90fd\u5f88\u5f31<br \/>&#8211; \u5927\u89c4\u6a21 scale out \u7684\u5b9e\u8df5\u6bd4\u8f83\u5c11\uff0c\u7f3a\u5c11\u6210\u719f\u7684\u57fa\u7840\u8bbe\u65bd\uff08 gateway\uff0c\u7ec6\u7c92\u5ea6\u76d1\u63a7\uff0c\u65e5\u5fd7\uff0c\u9650\u6d41\uff0c\u7b49\u7b49\uff09<br \/>&#8211; \u5f88\u96be\u5229\u7528 HTTP cache\uff0c\u9700\u8981\u524d\u7aef\u81ea\u5df1\u5b9e\u73b0 cache \u7cfb\u7edf<br \/>&#8211; \u670d\u52a1\u7aef n+1 \u67e5\u8be2\u95ee\u9898<br \/>&#8211; \u548c RESTful \u4e00\u6837\uff0c\u53ea\u662f\u4e00\u79cd\u5de5\u5177\uff0c\u6ca1\u6709\u5b98\u65b9\u8303\u5f0f\u3002\u6709\u4eba\u4f1a\u5199\u5d4c\u5957\u5f88\u6df1\u7684 field\uff0c\u6709\u4eba\u4f1a\u50cf RESTful \u4e00\u6837\u5168\u90e8\u6241\u5e73\u5316\uff0c\u751a\u81f3\u6709\u4eba\u5199\u51fa\u6765\u662f RPC style \uff08\u6211\u89c1\u8fc7 root query \u9876\u5c42 field \u5168\u90e8\u662f `getXxxByXxx` \u7684\u547d\u540d\u98ce\u683c\uff09<br \/>&#8211; \u4f7f\u7528\u6700\u5e7f\u6cdb\u7684 apollo-client \u81f3\u4eca\u7a33\u5b9a\u6027\u6b20\u4f73\uff0cbug \u5f88\u591a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101785\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jsq2627 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u4e2a\u5370\u8c61\u5f88\u6df1\u523b\u7684\u9879\u76ee\uff0c\u5145\u5206\u4f7f\u7528 apollo-client \u7684 cache \u540e\uff0c\u524d\u7aef\u72b6\u6001\u7ba1\u7406\u53d8\u7684\u975e\u5e38\u7b80\u5355\uff08\u4e00\u822c\u4e1a\u52a1\u9879\u76ee\uff0c\u6240\u8c13\u524d\u7aef\u72b6\u6001\u7ba1\u7406\uff0c\u57fa\u672c\u5c31\u662f\u628a fetch \u56de\u6765\u7684\u6570\u636e\u5b58\u5230 store \u91cc\u9762\uff1b apollo \u7684 cache \u5df2\u7ecf\u5e2e\u4f60\u5168\u641e\u5b9a\u4e86\uff09\u3002<br \/>\u8fd9\u4e2a\u9879\u76ee\u6700\u540e\u53ea\u7528\u4e86 React \u539f\u751f hooks \/ useReducer \/ context \u505a\u72b6\u6001\u7ba1\u7406\uff0c\u4ee5\u53ca\u4e00\u5c0f\u90e8\u5206 apollo local state \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101786\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : forgottencoast <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ReinerShir <br \/>\u4f60\u662f\u8bf4\u7684\u524d\u7aef\u5417\uff1f\u53cd\u6b63\u540e\u7aef\u662f\u4e0d\u4f1a\u624b\u5de5\u62fc\u53c2\u6570\u7684\u3002<br \/>\u5bf9\u4e8e\u540e\u7aef\u6765\u8bf4\uff0c\u5982\u679c\u9700\u8981\u5927\u6982\u90fd\u4f1a\u4f7f\u7528\u7c7b\u4f3c AddParameter(A, a)\u7684\u65b9\u6cd5\u6765\u624b\u52a8\u6dfb\u52a0\u53c2\u6570\u3002<br \/>\u56e0\u4e3a\u5bf9\u4e8e HTTP \u89c4\u8303\u6765\u8bf4\uff0c\u53c2\u6570\u7684\u5f62\u5f0f\u90fd\u662f\u4e00\u6837\u7684\uff1a<br \/>A=a&amp;B=b&amp;C=c<br \/>GET \u548c POST \u7684\u533a\u522b\u5728\u4e8e\u653e\u5728 header \u8fd8\u662f body \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101787\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : IvanLi127 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5f88\u597d\u7528\uff0c\u524d\u540e\u7aef\u90fd\u80fd\u7701\u5f88\u591a\u4e8b\uff0c\u5c31\u662f\u540e\u7aef\u8fd9\u8fb9\uff0c\u5173\u8054\u67e5\u8be2\u7684\u6027\u80fd\u597d\u50cf\u4e0d\u662f\u5f88\u597d\u4f18\u5316\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101788\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuanbg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Desiree \u8fd9\u4e2a\u8fd8\u9700\u8981\u7528\u8fc7\u624d\u77e5\u9053\u5417\uff1f\u524d\u7aef\u9700\u8981\u7684\u6570\u636e\u662f\u548c\u9875\u9762\u5339\u914d\u7684\uff0c\u4e00\u4e2a\u9875\u9762\u4e00\u4e2a\u7279\u5b9a\u7684\u63a5\u53e3\u83b7\u53d6\u6570\u636e\u96be\u9053\u4e0d\u662f\u6700\u7b80\u5355\u4e5f\u662f\u6700\u5408\u9002\u7684\u505a\u6cd5\u5417\uff1f\u8fd9\u4e2a\u6570\u636e\u7684\u5185\u5bb9\u548c\u5f62\u5f0f\uff0c\u7531\u524d\u7aef\u51b3\u5b9a\u8fd8\u662f\u524d\u540e\u7aef\u534f\u5546\u51b3\u5b9a\uff0c\u8fd9\u4e2a\u6570\u636e\u96be\u9053\u4f1a\u6709\u4e1d\u6beb\u7684\u4e0d\u540c\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101789\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : leeg810312 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             graphql \u662f\u5ba2\u6237\u7aef\u9a71\u52a8\u5f00\u53d1\uff0c\u6211\u7684\u7406\u89e3\u662f\u4ed6\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u6700\u5c0f\u5316\u5ba2\u6237\u7aef\u5411\u540e\u7aef\u8bf7\u6c42\uff0c\u5c0f\u9879\u76ee\u53ef\u80fd\u6bd4\u8f83\u5bb9\u6613\u505a\uff0c\u5927\u578b\u9879\u76ee\u5bf9\u7cfb\u7edf\u4ea4\u4e92\u8bbe\u8ba1\u8981\u6c42\u5f88\u9ad8\uff0c\u800c\u4e14\u8981\u6709\u5f88\u5f3a\u7684\u540e\u7aef\u56e2\u961f\u624d\u80fd\u7528\u597d\uff0c\u5426\u5219\u7cfb\u7edf\u6027\u80fd\u548c\u8fd0\u7ef4\u4f1a\u6709\u5f88\u5927\u95ee\u9898                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101790\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : masterclock <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Desiree \u4e00\u4e2a\u9875\u9762\u4e00\u4e2a\u7279\u5b9a\u7684\u63a5\u53e3\uff1f<br \/>\u5bf9\u524d\u7aef\u6765\u8bf4\u80af\u5b9a\u662f\u6700\u7f8e\u597d\u7684\u4e16\u754c\uff0c\u4f46\u540e\u7aef\u600e\u4e48\u529e\uff1f\u4e00\u4e2a\u9875\u9762\u5f88\u591a\u90fd\u4f1a\u5305\u542b\u6765\u81ea\u591a\u4e2a\u6a21\u5757\u3001\u670d\u52a1\u3001\u7cfb\u7edf\u7684\u6570\u636e\uff0c\u540e\u7aef\u600e\u4e48\u529e\uff1f\u524d\u7aef\u589e\u51cf\u9875\u9762\u3001\u9875\u9762\u4e2d\u7684\u6570\u636e\uff0c\u540e\u7aef\u4e00\u8d77\u6539\uff1f<br \/>\u7531\u524d\u7aef\u51b3\u5b9a\u8fd8\u662f\u524d\u540e\u7aef\u534f\u5546\u51b3\u5b9a\uff0c\u8fd9\u4e2a\u6570\u636e\u786e\u5b9e\u4f1a\u4e0d\u540c\u554a\uff0c\u524d\u7aef\u80af\u5b9a\u60f3\u7740\u4e00\u4e2a API \u62ff\u5230\u6240\u6709\u683c\u5f0f\u5316\u597d\u7684\u6570\u636e\uff0c\u540e\u7aef\u80af\u5b9a\u60f3\u62ff\u5230\u780d\u4eba\u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101791\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wwk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u589e\u52a0\u4e86\u590d\u6742\u5ea6\uff0c\u5e76\u4e14\u76ee\u524d\u7f3a\u4e4f\u597d\u7684\u5de5\u5177\u94fe\u6765\u642d\u914d\u4f7f\u7528\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101792\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aliipay <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @forgottencoast \u89c4\u8303\u8fd9\u4e9b\u7eaf\u5c5e\u6d6a\u8d39\u65f6\u95f4 ,\u5de5\u4f5c\u91cf\u4e0d\u9971\u548c\u624d\u641e\u8fd9\u4e9b\u73a9\u610f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101793\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : forgottencoast <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @aliipay \u590f\u866b\u4e0d\u53ef\u8bed\u51b0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101794\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : coymail <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             GraphQL \u66f4\u9002\u5408 OLAP \u573a\u666f\uff0c\u62ff\u6765\u5e72 OLTP \u4e0d\u592a\u5408\u9002\uff0c\u662f\u4e2a\u7c7b\u4f3c Gremlin \u7684\u56fe\u67e5\u8be2\u7ed3\u6784                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101795\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Sparetire <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u660e\u767d\u4e86\uff0c\u8fd9\u5e16\u5b50\u91cc\u633a\u591a\u7528\u90fd\u6ca1\u7528\u8fc7\u5c31\u5f00\u59cb\u53e3\u55e8\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101796\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wobuhuicode <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             GraphQL \u4e2a\u4eba\u9879\u76ee\u505a\u8d77\u6765\u723d\u3002\u524d\u540e\u7aef\u90fd\u662f\u81ea\u5df1\u63a7\u5236\u7684\uff0c\u67e5\u8be2\u8bed\u53e5\u653e\u5230\u524d\u7aef\u53bb\u4e00\u70b9\u95ee\u9898\u90fd\u6ca1\u6709\u3002\u4f46\u662f\u653e\u5728\u56e2\u961f\u6765\u8bf4\u7684\u8bdd\uff0c\u51cf\u8f7b\u4e86\u540e\u7aef\u538b\u529b\uff0c\u4f46\u662f\u589e\u52a0\u4e86\u524d\u7aef\u5de5\u4f5c\u91cf\u3002\u540c\u65f6\u589e\u52a0\u4e86\u6c9f\u901a\u6210\u672c\u3002<br \/>restful \u9648\u65e7\uff1f\u4f46\u662f\u89c4\u8303\u3002\u800c\u4e14\u57fa\u672c\u4e0a\u6240\u6709\u540e\u7aef\u90fd\u6709\u81ea\u5df1\u4e00\u5957 apidoc \u65b9\u6848\u3002\u5199\u5b8c\u4ee3\u7801\u5199\u4e0a\u6ce8\u91ca\u5c31\u51fa\u6587\u6863\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101797\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fansfans <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ReinerShir \u6211\u89c9\u5f97\u8fd9\u79cd\u60c5\u51b5\u4e0b\u7528 post \u95ee\u9898\u4e5f\u4e0d\u5927 \u6bd4\u5982\u524d\u7aef\u51fa\u73b0\u591a\u9009\u641c\u7d22\u7684\u60c5\u51b5 \u8fd9\u4e2a\u65f6\u5019\u9700\u8981\u4f20\u9012\u4e00\u4e2a\u5217\u8868 \u540c\u65f6\u5185\u5bb9\u6bd4\u8f83\u591a\u5bb9\u6613\u8d85\u51fa\u6d4f\u89c8\u5668\u9650\u5236 \u7528 post \u662f\u6700\u7a33\u59a5\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101798\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : flyhelan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wobuhuicode <br \/>\u600e\u4e48\u4f60\u8fd9\u91cc\u8bf4\u662f\u51cf\u8f7b\u4e86\u540e\u7aef\u538b\u529b\uff1f\u524d\u9762\u7684\u670b\u53cb\u8bf4\u7684\u662f\u589e\u52a0\u4e86\u540e\u7aef\u7684\u538b\u529b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101799\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : a67793581 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @flyhelan \u6280\u672f\u597d\u7684\u51cf\u8f7b\u5de5\u4f5c\u91cf \u6280\u672f\u4e0d\u597d\u7684\u589e\u52a0\u5de5\u4f5c\u91cf \u56e0\u4e3a\u8fd9\u4e2a\u4e1c\u897f\u8d44\u6599\u4e0d\u591a\u5de5\u5177\u4e5f\u5c11 \u5f88\u591a\u65f6\u5019\u8981\u8003\u9a8c\u540e\u7aef\u7684\u6280\u672f\u80fd\u529b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101800\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : ReinerShir <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @fansfans \u662f\u7684\uff0c\u6240\u4ee5\u4e25\u683c\u9075\u5b88 restful \u51e0\u4e4e\u4e0d\u592a\u53ef\u80fd <\/p>\n<p>\u53e6\u5916\u770b\u4e86\u4e0b\u5927\u5bb6\u7684\u56de\u590d\uff0c\u90fd\u662f\u5404\u6267\u4e00\u8bcd\uff0c\u5982\u6b64\u6765\u770b\u597d\u4e0d\u597d\u7528\u53ea\u80fd\u81ea\u5df1\u53bb\u8bd5\u8bd5\u770b\u518d\u8bf4\u4e86\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5101801\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : WinnieNumberTwo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @flyhelan \u540e\u7aef\u538b\u529b\u4e3b\u8981\u5728\u4e8e\u5b66\u4e60\u65b0\u7684\u6280\u672f\uff0c\u771f\u6b63\u638c\u63e1\u4e86\u7684\u8bdd\u6700\u7ec8\u589e\u52a0\u7684\u662f\u524d\u7aef\u7684\u4e1a\u52a1\u538b\u529b:\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u7528\u8fc7 GraphQL \u7684\u5417\uff1f\u53ef\u4ee5&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/317991"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=317991"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/317991\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317991"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}