{"id":302571,"date":"2020-04-27T09:00:48","date_gmt":"2020-04-27T09:00:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302571"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-04-27T09:00:48","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302571","title":{"rendered":"[\u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430] \u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 GraphQL \u0441\u0435\u0440\u0432\u0435\u0440"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/499084\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/py\/-z\/fc\/py-zfcuqt5-oh3-6yddlgzyidn4.png\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 GraphQL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0435\u0449\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u0441\u043f\u0430\u0441\u0438\u0431\u043e Express \u0438 Node.js.<\/p>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u0431\u0440\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b SOAP? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u043b\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0435\u0433\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b REST, \u0438 \u043e\u043d \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435. \u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c REST \u0438\u0437-\u0437\u0430 GraphQL?<\/p>\n<h4>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  GraphQL \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 Facebook \u0432 2012 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 (\u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u0441\u0442\u0430\u0432\u0448\u0438\u0439 \u00ab\u043e\u043f\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u043c\u00bb) \u0432 2015. \u041e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0437\u0430 \u0442\u0435\u043c, \u043a\u0430\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c REST \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445: \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043c\u044f \u0438 email \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c\u2026 \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438? \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0438\u0441\u043e\u043a ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e API \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041a\u0430\u043a\u043e\u0435 \u043d\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432! GraphQL \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 API \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e (\u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>  GraphQL \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 SDL (Schema Definition Language), \u0447\u0442\u043e \u043e\u0431\u0443\u0441\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e. \u0421\u0445\u0435\u043c\u044b GraphQL \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f (\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f) \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0442.\u0435. \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e \u043f\u0440\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043b\u044e\u0431\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0442\u0438\u043f\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h4>\u041f\u0440\u0438\u0437\u043d\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c \u0438 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a REST, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 API \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u044b \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c\u0438. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0441 \u00ab<a href=\"https:\/\/someapi.dev\/v1\/myendpoint\" rel=\"nofollow\">someapi.dev\/v1\/myendpoint<\/a>\u00bb \u043d\u0430 \u00ab<a href=\"https:\/\/someapi.dev\/v2\/myNewEndpoint\" rel=\"nofollow\">someapi.dev\/v2\/myNewEndpoint<\/a>\u00bb \u0438\u0437-\u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. GraphQL \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 API \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h3>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:<\/p>\n<pre><code class=\"javascript\">$ yarn add graphql express express-graphql <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b &quot;.\/main.js&quot; \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 Express Server:<\/p>\n<pre><code class=\"javascript\">const express = require('express') const app = express() const port = process.env.PORT || 3000  app.get('\/' (req, res) =&gt; {   res.send('Hello World!') })  app.listen(port, () =&gt; {   console.log(`Server ready on port http:\/\/localhost:${port}`) }) <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: npm .\/main.js<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/td\/in\/n8\/tdinn8ufrwvex48x6nj6ww4bpry.png\"><\/p>\n<p>  \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u043b\u0443\u0447\u0448\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 GraphQL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"https:\/\/github.com\/graphql\/graphiql\" rel=\"nofollow\">Graph<strong>i<\/strong>QL<\/a>:<\/p>\n<pre><code class=\"javascript\">const express = require('express') const expressGraphQL = require('express-graphql') const {     buildSchema } = require('graphql') const app = express() const port = process.env.PORT || 3000  const schema = buildSchema(`     type Query {         message: String     } `)  const rootValue = {     message() {         return 'Hello World!'     }      app.use('\/graphql', expressGraphQL({         schema,         rootValue,         graphiql: true     }))      app.get('\/', (req, res) =&gt; {         res.send('Hello World!')     })      app.listen(port, () =&gt; {         console.log(`Server ready on port http:\/\/localhost:${port}`)     }) } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043c\u044b \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0435\u043c:<\/p>\n<ul>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 Express GraphQL (express-graphql)<\/li>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u00abbuildSchema\u00bb, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0445\u0435\u043c\u0443 (Schema) GraphQL, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430<\/li>\n<li>\u041d\u0430 7 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0445\u0435\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f SDL. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0438\u043f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f message, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u043e\u0439)<\/li>\n<li>\u041d\u0430 13 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c Resolver: \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 message, Resolver \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u00abHello World!\u00bb. \u041b\u0435\u0433\u043a\u043e, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438?<\/li>\n<li>\u043d\u0430 19 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 &quot;\/graphql&quot;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 express-graphql \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 GraphiQL<\/li>\n<\/ul>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>&quot;http:\/\/localhost:3000\/graphql&quot;<\/code>:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wc\/qt\/wo\/wcqtwoflakt2rpixmnlnfecdwwe.png\"><\/p>\n<p>  \u041a\u0440\u0443\u0442\u043e! \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 GraphQL \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430! \u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0435, \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0432 message:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qm\/vj\/2z\/qmvj2zyixirxs7oyxvvqbebvosg.png\"><\/p>\n<p>  \u041f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u043d\u043e. \u041c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 GraphQL \u0441\u0435\u0440\u0432\u0435\u0440! \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b &quot;.\/data.js&quot;:<\/p>\n<pre><code class=\"javascript\">module.exports = [{         id: 1,         name: &quot;Java&quot;,         createdBy: &quot;James Gosling&quot;,         year: 1995,         paradigm: &quot;Object Oriented&quot;,         complexity: 7     },     {         id: 2,         name: &quot;PHP&quot;,         createdBy: &quot;Rasmus Lerdorf&quot;,         year: 1995,         paradigm: &quot;Object Oriented&quot;,         complexity: 3     },     {         id: 3,         name: &quot;C&quot;,         createdBy: &quot;Dennis Ritchie&quot;,         year: 1972,         paradigm: &quot;Imperative&quot;,         complexity: 10     },     {         id: 4,         name: &quot;Erlang&quot;,         createdBy: &quot;Joe Armstrong&quot;,         year: 1986,         paradigm: &quot;Functional&quot;,         complexity: 8     },     {         id: 5,         name: &quot;OCaml&quot;,         createdBy: &quot;INRIA&quot;,         year: 1996,         paradigm: &quot;Functional&quot;,         complexity: 8     },     {         id: 6,         name: &quot;LISP&quot;,         createdBy: &quot;John McCarthy&quot;,         year: 1958,         paradigm: &quot;Functional&quot;,         complexity: 6     } ] <\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430.<\/p>\n<p>  \u0414\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0435\u0442\u0438\u0439 \u0444\u0430\u0439\u043b &quot;.\/graphqlData.js&quot;:<\/p>\n<pre><code class=\"javascript\">const { buildSchema } = require('graphql') const data = require('.\/data')  const schema = buildSchema(` type Query {     language(id: Int!): Language     languages(paradigm: String): [Language] }      type Language {         id: Int         name: String         createBy: String         year: Int         paradigm: String         complexity: Int     } `) <\/code><\/pre>\n<p>  \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 buildSchema. \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 GraphQL. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0442\u0438\u043f Query, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c:<\/p>\n<ul>\n<li>\u041f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u043e ID (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c). \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f Language, \u043e \u0442\u0438\u043f\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u0437\u0436\u0435<\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a (\u043c\u0430\u0441\u0441\u0438\u0432 \u0432 JavaScript) \u044f\u0437\u044b\u043a\u043e\u0432, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0443. \u0422\u0438\u043f\u043e\u043c \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 (String), \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a (\u043c\u0430\u0441\u0441\u0438\u0432) \u044f\u0437\u044b\u043a\u043e\u0432 (Language).<\/li>\n<\/ul>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0442\u0438\u043f Language. \u041f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e GraphQL \u0442\u0438\u043f\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0423 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f ID \u0441 \u0442\u0438\u043f\u043e\u043c Int, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c String \u0438 \u0442.\u0434.<\/p>\n<p>  \u0414\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"javascript\">function getLanguage(args) {     return data.filter(language =&gt; language.id === args.id)[0] }  function getLanguages(args) {     return args.paradigm ?         data.filter(language =&gt; language.paradigm === args.paradigm) :         data }  const rootValue = {     language: getLanguage,     languages: getLanguages } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430:<\/p>\n<ul>\n<li>getLanguage \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 Object \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u044f\u0437\u044b\u043a \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c ID<\/li>\n<li>getLanguages \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 Object \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044f\u0437\u044b\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b<\/li>\n<li>rootValue \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0432 express-graphql<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0432 \u0441\u0445\u0435\u043c\u0435.<\/p>\n<p>  \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">const {     buildSchema } = require(&quot;graphql&quot;); const data = require(&quot;.\/data&quot;);  const schema = buildSchema(`     type Query {         language(id: Int!): Language         languages(paradigm: String): [Language]     }      type Language {         id: Int         name: String         createdBy: String         year: Int         paradigm: String         complexity: Int     } `);  function getLanguage(args) {     return data.filter(language =&gt; language.id === args.id)[0] }  function getLanguages(args) {     return args.paradigm ?         data.filter(language =&gt; language.paradigm === args.paradigm) :         data }  const rootValue = {     language: getLanguage,     languages: getLanguages, }  module.exports = {     schema,     getLanguage,     getLanguages,     rootValue } <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043c main.js:<\/p>\n<pre><code class=\"javascript\">const express = require('express') const expressGraphQL = require('express-graphql') const graphQLData = require('.\/graphQLData') const app = express() const port = process.env.PORT || 3000  app.use('\/graphql', expressGraphQL({     schema: graphQLData.schema,     rootValue: graphQLData.rootValue,     graphiql: true }))  app.get('\/', (req, res) =&gt; {     res.send('Hello World!') })  app.listen(port, () =&gt; {     console.log(`Server ready on port http:\/\/localhost:${port}`) }) <\/code><\/pre>\n<p>  \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-l\/x9\/e-\/-lx9e-bkhifxkzxfggmgja_e6iu.png\"><\/p>\n<p>  \u041a\u0440\u0443\u0442\u043e. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6w\/r5\/xj\/6wr5xjs0ku02hzc5gqcfssosce4.png\"><\/p>\n<p>  \u041b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gh\/sq\/sf\/ghsqsfr0esms8j6gowim7qdag7o.png\"><\/p>\n<p>  \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 GraphQL \u0441\u0435\u0440\u0432\u0435\u0440. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u043e\u0442\u043a\u0443\u0434\u0430 \u0443\u0433\u043e\u0434\u043d\u043e. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f!<\/p>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/499084\/\"> https:\/\/habr.com\/ru\/post\/499084\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/499084\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/py\/-z\/fc\/py-zfcuqt5-oh3-6yddlgzyidn4.png\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 GraphQL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0435\u0449\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u0441\u043f\u0430\u0441\u0438\u0431\u043e Express \u0438 Node.js.<\/p>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u0431\u0440\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b SOAP? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u043b\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0435\u0433\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b REST, \u0438 \u043e\u043d \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435. \u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c REST \u0438\u0437-\u0437\u0430 GraphQL?<\/p>\n<h4>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  GraphQL \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 Facebook \u0432 2012 \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 (\u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u0441\u0442\u0430\u0432\u0448\u0438\u0439 \u00ab\u043e\u043f\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u043c\u00bb) \u0432 2015. \u041e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0437\u0430 \u0442\u0435\u043c, \u043a\u0430\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c REST \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445: \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043c\u044f \u0438 email \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c\u2026 \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438? \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0438\u0441\u043e\u043a ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e API \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u2014 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041a\u0430\u043a\u043e\u0435 \u043d\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432! GraphQL \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 API \u0438\u0437\u0431\u0438\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e (\u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0433\u043e) \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-302571","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302571"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302571\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}