{"id":511,"date":"2024-09-20T18:08:34","date_gmt":"2024-09-20T10:08:34","guid":{"rendered":"https:\/\/ahui.blog\/?p=511"},"modified":"2024-09-20T18:08:43","modified_gmt":"2024-09-20T10:08:43","slug":"graphql","status":"publish","type":"post","link":"https:\/\/ahui.blog\/index.php\/2024\/09\/20\/graphql\/","title":{"rendered":"GraphQL\u7528\u6cd5\u7b14\u8bb0"},"content":{"rendered":"<h3>GraphQL\u8bed\u6cd5\u7ed3\u6784<\/h3>\n<h4>1. <strong><code>operationName<\/code><\/strong><\/h4>\n<ul>\n<li>\n<p><strong>\u5b9a\u4e49<\/strong>: <code>operationName<\/code> \u662f\u4e00\u4e2a\u53ef\u9009\u53c2\u6570\uff0c\u7528\u6765\u6807\u8bc6 GraphQL \u64cd\u4f5c\u7684\u540d\u79f0\uff0c\u901a\u5e38\u7528\u6765\u63cf\u8ff0\u6216\u6807\u8bc6\u4e00\u4e2a\u7279\u5b9a\u7684\u67e5\u8be2\u6216\u64cd\u4f5c\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f5c\u7528<\/strong>:<\/p>\n<ul>\n<li>\u5f53\u540c\u4e00\u8bf7\u6c42\u4e2d\u5305\u542b\u591a\u4e2a\u67e5\u8be2\u6216\u53d8\u66f4\u64cd\u4f5c\u65f6\uff0c<code>operationName<\/code> \u7528\u4e8e\u660e\u786e\u6307\u5b9a\u6267\u884c\u54ea\u4e00\u4e2a\u64cd\u4f5c\u3002<\/li>\n<li>\u5982\u679c\u5728\u8bf7\u6c42\u4e2d\u53ea\u5305\u542b\u4e00\u4e2a\u67e5\u8be2\u6216\u53d8\u66f4\u64cd\u4f5c\uff0c<code>operationName<\/code> \u662f\u53ef\u9009\u7684\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u793a\u4f8b<\/strong>:<\/p>\n<pre><code>query GetUser {\nuser(id: \"1\") {\n  id\n  name\n}\n}<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u60f3\u7ed9\u8fd9\u4e2a\u67e5\u8be2\u547d\u540d\uff0c<code>operationName<\/code> \u53ef\u4ee5\u662f <code>GetUser<\/code>\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre><code class=\"language-json\">{\n\"operationName\": \"GetUser\",\n\"query\": \"query GetUser { user(id: \\\"1\\\") { id name } }\"\n}<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>2. <strong><code>variables<\/code><\/strong><\/h4>\n<ul>\n<li>\n<p><strong>\u5b9a\u4e49<\/strong>: <code>variables<\/code> \u662f\u4e00\u4e2a JSON \u5bf9\u8c61\uff0c\u5305\u542b\u52a8\u6001\u4f20\u9012\u7ed9 GraphQL \u67e5\u8be2\u6216\u53d8\u66f4\u64cd\u4f5c\u7684\u53d8\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f5c\u7528<\/strong>:<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>variables<\/code> \u53ef\u4ee5\u907f\u514d\u5728\u67e5\u8be2\u4e2d\u786c\u7f16\u7801\u53c2\u6570\uff0c\u4f7f\u5f97\u67e5\u8be2\u66f4\u52a0\u7075\u6d3b\u548c\u53ef\u91cd\u7528\u3002<\/li>\n<li>\u4f60\u53ef\u4ee5\u901a\u8fc7\u53d8\u91cf\u52a8\u6001\u4f20\u5165\u67e5\u8be2\u7684\u53c2\u6570\uff0c\u907f\u514d\u6bcf\u6b21\u4fee\u6539\u67e5\u8be2\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u793a\u4f8b<\/strong>: GraphQL \u67e5\u8be2\u53ef\u4ee5\u901a\u8fc7\u53d8\u91cf\u63a5\u6536\u53c2\u6570\uff1a<\/p>\n<pre><code>query GetUser($id: ID!) {\nuser(id: $id) {\n  id\n  name\n}\n}<\/code><\/pre>\n<p>\u8fd9\u91cc\u7684 <code>$id<\/code> \u662f\u53d8\u91cf\uff0c\u5728\u5b9e\u9645\u8bf7\u6c42\u65f6\u53ef\u4ee5\u901a\u8fc7 <code>variables<\/code> \u63d0\u4f9b\u8fd9\u4e2a\u53c2\u6570\uff1a<\/p>\n<pre><code>{\n\"operationName\": \"GetUser\",\n\"query\": \"query GetUser($id: ID!) { user(id: $id) { id name } }\",\n\"variables\": {\n  \"id\": \"1\"\n}\n}<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>3. <strong><code>query<\/code><\/strong><\/h4>\n<ul>\n<li>\n<p><strong>\u5b9a\u4e49<\/strong>: <code>query<\/code> \u5305\u542b\u5b9e\u9645\u7684 GraphQL \u67e5\u8be2\u6216\u53d8\u66f4\u64cd\u4f5c\uff0c\u662f GraphQL \u8bf7\u6c42\u7684\u6838\u5fc3\u90e8\u5206\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u4f5c\u7528<\/strong>:<\/p>\n<ul>\n<li><code>query<\/code> \u662f\u7528\u6765\u5b9a\u4e49\u4f60\u60f3\u8981\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u67e5\u8be2\u6570\u636e\u3001\u53d8\u66f4\u6570\u636e\u7b49\u3002\u5b83\u5305\u542b\u67e5\u8be2\u7684\u7ed3\u6784\u548c\u5b57\u6bb5\uff0c\u6307\u5b9a\u9700\u8981\u4ece\u670d\u52a1\u5668\u83b7\u53d6\u7684\u6570\u636e\u3002<\/li>\n<li>GraphQL \u67e5\u8be2\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5305\u542b\u67e5\u8be2\u7c7b\u578b\u3001\u5b57\u6bb5\u3001\u53c2\u6570\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u793a\u4f8b<\/strong>: \u8fd9\u662f\u4e00\u4e2a\u5305\u542b\u5b9e\u9645\u67e5\u8be2\u7684 <code>query<\/code>\uff1a<\/p>\n<pre><code>{\n\"query\": \"query GetUser($id: ID!) { user(id: $id) { id name } }\"\n}<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>\u7efc\u5408\u793a\u4f8b\uff1a<\/h4>\n<p>\u5f53\u4f60\u9700\u8981\u901a\u8fc7 GraphQL \u67e5\u8be2\u83b7\u53d6\u67d0\u4e2a\u7528\u6237\u7684\u4fe1\u606f\uff0c\u5e76\u4f7f\u7528\u53d8\u91cf\u52a8\u6001\u4f20\u9012\u7528\u6237\u7684 ID \u65f6\uff0c\u5b8c\u6574\u7684\u67e5\u8be2\u8bf7\u6c42\u53ef\u80fd\u4f1a\u50cf\u8fd9\u6837\uff1a<\/p>\n<pre><code>{\n  &quot;operationName&quot;: &quot;GetUser&quot;,\n  &quot;query&quot;: &quot;query GetUser($id: ID!) { user(id: $id) { id name } }&quot;,\n  &quot;variables&quot;: {\n    &quot;id&quot;: &quot;1&quot;\n  }\n}<\/code><\/pre>\n<ul>\n<li><strong><code>operationName<\/code><\/strong>: <code>GetUser<\/code> \u7528\u6765\u6807\u8bc6\u5f53\u524d\u64cd\u4f5c\u3002<\/li>\n<li><strong><code>query<\/code><\/strong>: \u5b9e\u9645\u7684 GraphQL \u67e5\u8be2\u5b57\u7b26\u4e32\uff0c\u5305\u542b\u67e5\u8be2\u7c7b\u578b\u3001\u53c2\u6570\u548c\u9700\u8981\u8fd4\u56de\u7684\u5b57\u6bb5\u3002<\/li>\n<li><strong><code>variables<\/code><\/strong>: \u7528\u6765\u4f20\u9012\u53d8\u91cf\uff0c\u8fd9\u91cc\u901a\u8fc7 <code>variables<\/code> \u5c06\u7528\u6237\u7684 <code>id<\/code> \u4f20\u9012\u7ed9\u67e5\u8be2\u3002<\/li>\n<\/ul>\n<h4>\u603b\u7ed3\uff1a<\/h4>\n<ul>\n<li><strong><code>operationName<\/code><\/strong>: \u7528\u6765\u7ed9\u67e5\u8be2\u6216\u53d8\u66f4\u64cd\u4f5c\u547d\u540d\uff0c\u4fbf\u4e8e\u5728\u591a\u4e2a\u64cd\u4f5c\u4e2d\u6307\u5b9a\u6267\u884c\u54ea\u4e2a\u64cd\u4f5c\u3002<\/li>\n<li><strong><code>variables<\/code><\/strong>: \u662f\u4f20\u9012\u7ed9\u67e5\u8be2\u6216\u53d8\u66f4\u64cd\u4f5c\u7684\u53c2\u6570\uff0c\u53ef\u4ee5\u52a8\u6001\u8c03\u6574\u67e5\u8be2\u7684\u8f93\u5165\u3002<\/li>\n<li><strong><code>query<\/code><\/strong>: \u662f\u5b9e\u9645\u7684 GraphQL \u67e5\u8be2\u6216\u53d8\u66f4\u64cd\u4f5c\uff0c\u5305\u542b\u8bf7\u6c42\u7684\u7ed3\u6784\u548c\u5b57\u6bb5\u5b9a\u4e49\u3002<\/li>\n<\/ul>\n<h3>\u81ea\u7701\u67e5\u8be2<\/h3>\n<h4>\u65b9\u6cd5 1: \u4f7f\u7528 <code>__type<\/code> introspection query \u67e5\u8be2\u7c7b\u578b\u4fe1\u606f<\/h4>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528 GraphQL \u7684 introspection \u6765\u67e5\u8be2 <code>User<\/code> \u7c7b\u578b\u7684\u6240\u6709\u5b57\u6bb5\u3002\u53ef\u4ee5\u901a\u8fc7 <code>__type<\/code> introspection \u67e5\u8be2\u6765\u83b7\u53d6 <code>User<\/code> \u7c7b\u578b\u7684\u5b9a\u4e49\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u6784\u9020\u67e5\u8be2\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>{\n  __type(name: &quot;User&quot;) {\n    name\n    fields {\n      name\n      type {\n        name\n        kind\n        ofType {\n          name\n          kind\n        }\n      }\n    }\n  }\n}<\/code><\/pre>\n<h5>\u89e3\u91ca\uff1a<\/h5>\n<ul>\n<li><code>__type(name: &quot;User&quot;)<\/code>\uff1a\u67e5\u8be2 GraphQL \u7c7b\u578b\u4e3a <code>User<\/code> \u7684\u6240\u6709\u5b57\u6bb5\u4fe1\u606f\u3002<\/li>\n<li><code>fields<\/code>\uff1a\u5217\u51fa\u8be5\u7c7b\u578b\u7684\u6240\u6709\u5b57\u6bb5\u540d\u79f0\u53ca\u5176\u7c7b\u578b\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u67e5\u8be2\u5c06\u8fd4\u56de <code>User<\/code> \u7c7b\u578b\u7684\u6240\u6709\u5b57\u6bb5\u5217\u8868\uff0c\u5305\u62ec\u6bcf\u4e2a\u5b57\u6bb5\u7684\u540d\u79f0\u548c\u5b57\u6bb5\u7c7b\u578b\u3002<\/p>\n<h4>\u65b9\u6cd5 2: \u4f7f\u7528\u5de5\u5177\u67e5\u770b schema<\/h4>\n<p>\u5982\u679c\u4f60\u6ca1\u6709\u6743\u9650\u8fd0\u884c introspection \u67e5\u8be2\uff0c\u6216\u8005 introspection \u529f\u80fd\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u88ab\u7981\u7528\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u5de5\u5177\u67e5\u770b schema \u4e2d\u7684\u6240\u6709\u5b57\u6bb5\uff1a<\/p>\n<ol>\n<li>GraphQL Playground \u6216 GraphiQL\uff1a\n<ul>\n<li>\u5728\u8fd9\u4e9b\u5f00\u53d1\u5de5\u5177\u4e2d\uff0c\u4f60\u53ef\u4ee5\u5728\u6587\u6863\u680f\uff08Docs\uff09\u4e2d\u67e5\u627e <code>User<\/code> \u7c7b\u578b\u7684\u6240\u6709\u5b57\u6bb5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>Apollo Studio\uff1a\n<ul>\n<li>\u5982\u679c\u4f60\u7684 API \u5728 Apollo Server \u4e0a\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528 Apollo Studio \u6765\u68c0\u67e5 schema \u4e2d\u7684\u6240\u6709\u5b57\u6bb5\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4>\u65b9\u6cd5 3: \u901a\u8fc7 introspection \u67e5\u8be2 schema \u7684\u6240\u6709\u7c7b\u578b<\/h4>\n<p>\u4f60\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u67e5\u8be2\u83b7\u53d6\u6574\u4e2a schema \u4e2d\u6240\u6709\u7c7b\u578b\u7684\u4fe1\u606f\uff0c\u7136\u540e\u627e\u5230 <code>User<\/code> \u7c7b\u578b\u3002<\/p>\n<pre><code>{\n  __schema {\n    types {\n      name\n      fields {\n        name\n      }\n    }\n  }\n}<\/code><\/pre>\n<h4>\u65b9\u6cd5 4: \u901a\u8fc7 IntrospectionQuery\u67e5\u8be2 schema \u7684\u6240\u6709\u7c7b\u578b<\/h4>\n<pre><code>query IntrospectionQuery{__schema{queryType{name}mutationType{name}subscriptionType{name}types{...FullType}directives{name description locations args{...InputValue}}}}fragment FullType on __Type{kind name description fields(includeDeprecated:true){name description args{...InputValue}type{...TypeRef}isDeprecated deprecationReason}inputFields{...InputValue}interfaces{...TypeRef}enumValues(includeDeprecated:true){name description isDeprecated deprecationReason}possibleTypes{...TypeRef}}fragment InputValue on __InputValue{name description type{...TypeRef}defaultValue}fragment TypeRef on __Type{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name ofType{kind name}}}}}}}}<\/code><\/pre>\n<h3>\u5e38\u89c1\u67e5\u8be2<\/h3>\n<h4>1. <strong><code>query<\/code><\/strong>\uff1a\u67e5\u8be2\u64cd\u4f5c<\/h4>\n<ul>\n<li>\n<p><strong>\u5b9a\u4e49<\/strong>: \u7528\u4e8e\u83b7\u53d6\u6570\u636e\uff0c\u4e0d\u4f1a\u4fee\u6539\u670d\u52a1\u5668\u7aef\u7684\u6570\u636e\u72b6\u6001\uff0c\u7c7b\u4f3c\u4e8e REST API \u4e2d\u7684 <code>GET<\/code> \u8bf7\u6c42\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u793a\u4f8b<\/strong>:<\/p>\n<pre><code>query {\nsession {\n  id\n  __typename\n}\n}<\/code><\/pre>\n<p>\u8fd9\u4e2a\u67e5\u8be2\u8bf7\u6c42\u4e86 <code>session<\/code> \u6570\u636e\uff0c\u5e76\u8fd4\u56de\u4f1a\u8bdd\u7684 <code>id<\/code> \u548c\u7c7b\u578b\u4fe1\u606f\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>2. <strong><code>mutation<\/code><\/strong>\uff1a\u53d8\u66f4\u64cd\u4f5c<\/h4>\n<ul>\n<li>\n<p><strong>\u5b9a\u4e49<\/strong>: \u7528\u4e8e\u4fee\u6539\u670d\u52a1\u5668\u7aef\u7684\u6570\u636e\uff0c\u7c7b\u4f3c\u4e8e REST API \u4e2d\u7684 <code>POST<\/code>\u3001<code>PUT<\/code>\u3001<code>DELETE<\/code> \u8bf7\u6c42\u3002\u901a\u5e38\u7528\u4e8e\u521b\u5efa\u3001\u66f4\u65b0\u6216\u5220\u9664\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u793a\u4f8b<\/strong>:<\/p>\n<pre><code>mutation {\ncreateUser(input: { name: \"John\", email: \"john@example.com\" }) {\n  id\n  name\n  email\n}\n}<\/code><\/pre>\n<p>\u8fd9\u4e2a <code>mutation<\/code> \u8bf7\u6c42\u7528\u4e8e\u521b\u5efa\u4e00\u4e2a\u7528\u6237\uff0c\u5e76\u8fd4\u56de\u521b\u5efa\u6210\u529f\u540e\u7684\u7528\u6237 <code>id<\/code>\u3001<code>name<\/code> \u548c <code>email<\/code>\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>3. <strong><code>subscription<\/code><\/strong>\uff1a\u8ba2\u9605\u64cd\u4f5c<\/h4>\n<ul>\n<li>\n<p><strong>\u5b9a\u4e49<\/strong>: \u7528\u4e8e\u8ba2\u9605\u670d\u52a1\u7aef\u7684\u6570\u636e\u53d8\u66f4\uff0c\u5f53\u6570\u636e\u53d1\u751f\u53d8\u5316\u65f6\uff0c\u670d\u52a1\u5668\u4f1a\u81ea\u52a8\u5c06\u66f4\u65b0\u7684\u6570\u636e\u63a8\u9001\u5230\u5ba2\u6237\u7aef\u3002\u9002\u7528\u4e8e\u5b9e\u65f6\u6570\u636e\u66f4\u65b0\uff0c\u7c7b\u4f3c\u4e8e WebSockets\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u793a\u4f8b<\/strong>:<\/p>\n<pre><code>subscription {\nmessageAdded {\n  id\n  content\n  user {\n    id\n    name\n  }\n}\n}<\/code><\/pre>\n<p>\u8fd9\u4e2a <code>subscription<\/code> \u8bf7\u6c42\u8ba2\u9605\u4e86\u65b0\u6d88\u606f\u7684\u6dfb\u52a0\uff0c\u5f53\u6709\u65b0\u6d88\u606f\u65f6\uff0c\u670d\u52a1\u5668\u4f1a\u63a8\u9001\u6d88\u606f\u7684 <code>id<\/code>\u3001<code>content<\/code> \u4ee5\u53ca\u53d1\u9001\u8005\u7684 <code>id<\/code> \u548c <code>name<\/code>\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>GraphQL \u4e2d\u7684\u4e09\u5927\u64cd\u4f5c\u7c7b\u578b\u603b\u7ed3\uff1a<\/h4>\n<ol>\n<li>\n<p><code>query<\/code>\uff1a<\/p>\n<ul>\n<li><strong>\u4f5c\u7528<\/strong>: \u83b7\u53d6\u6570\u636e\uff08\u8bfb\u53d6\u64cd\u4f5c\uff09\u3002<\/li>\n<li><strong>\u7c7b\u4f3c\u4e8e<\/strong>: REST API \u4e2d\u7684 <code>GET<\/code> \u8bf7\u6c42\u3002<\/li>\n<li><strong>\u662f\u5426\u4fee\u6539\u6570\u636e<\/strong>: \u5426\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>mutation<\/code>\uff1a<\/p>\n<ul>\n<li><strong>\u4f5c\u7528<\/strong>: \u4fee\u6539\u6570\u636e\uff08\u521b\u5efa\u3001\u66f4\u65b0\u3001\u5220\u9664\u64cd\u4f5c\uff09\u3002<\/li>\n<li><strong>\u7c7b\u4f3c\u4e8e<\/strong>: REST API \u4e2d\u7684 <code>POST<\/code>\u3001<code>PUT<\/code>\u3001<code>DELETE<\/code> \u8bf7\u6c42\u3002<\/li>\n<li><strong>\u662f\u5426\u4fee\u6539\u6570\u636e<\/strong>: \u662f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>subscription<\/code>\uff1a<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li><strong>\u4f5c\u7528<\/strong>: \u5b9e\u65f6\u8ba2\u9605\u6570\u636e\u53d8\u5316\uff0c\u5f53\u670d\u52a1\u7aef\u6570\u636e\u53d8\u5316\u65f6\u901a\u77e5\u5ba2\u6237\u7aef\u3002\n<ul>\n<li><strong>\u7c7b\u4f3c\u4e8e<\/strong>: WebSockets\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u662f\u5426\u4fee\u6539\u6570\u636e<\/strong>: \u5426\uff0c\u4e3b\u8981\u7528\u4e8e\u5b9e\u65f6\u6570\u636e\u63a8\u9001\u3002<\/li>\n<\/ul>\n<h4>\u603b\u7ed3<\/h4>\n<ul>\n<li><strong><code>query<\/code><\/strong>\uff1a\u7528\u4e8e\u67e5\u8be2\u548c\u83b7\u53d6\u6570\u636e\u3002<\/li>\n<li><strong><code>mutation<\/code><\/strong>\uff1a\u7528\u4e8e\u4fee\u6539\u6570\u636e\u3002<\/li>\n<li><strong><code>subscription<\/code><\/strong>\uff1a\u7528\u4e8e\u8ba2\u9605\u5b9e\u65f6\u6570\u636e\u66f4\u65b0\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>GraphQL\u8bed\u6cd5\u7ed3\u6784 1. operationName \u5b9a\u4e49: operationName \u662f\u4e00\u4e2a\u53ef\u9009\u53c2\u6570\uff0c &#8230; <a title=\"GraphQL\u7528\u6cd5\u7b14\u8bb0\" class=\"read-more\" href=\"https:\/\/ahui.blog\/index.php\/2024\/09\/20\/graphql\/\" aria-label=\"\u7ee7\u7eed\u9605\u8bfbGraphQL\u7528\u6cd5\u7b14\u8bb0\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,14],"tags":[32],"class_list":["post-511","post","type-post","status-publish","format-standard","hentry","category-basic_knowledge","category-safety_research","tag-graphql"],"_links":{"self":[{"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/posts\/511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/comments?post=511"}],"version-history":[{"count":1,"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/posts\/511\/revisions"}],"predecessor-version":[{"id":512,"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/posts\/511\/revisions\/512"}],"wp:attachment":[{"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/media?parent=511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/categories?post=511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahui.blog\/index.php\/wp-json\/wp\/v2\/tags?post=511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}