{"id":373380,"date":"2024-05-21T05:34:50","date_gmt":"2024-05-21T05:34:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=373380"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=373380","title":{"rendered":"<span>\u0421\u0442\u0430\u0440\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c GraphQL \/ DGS Framework<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u044b \u2013 \u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0430 \u0438 \u0412\u0438\u043a\u0442\u043e\u0440\u0438\u044f, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u00a0<a href=\"https:\/\/bftcom.com\/career\/\">\u0411\u0424\u0422-\u0425\u043e\u043b\u0434\u0438\u043d\u0433\u0435<\/a>. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u0445, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0438\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 WebFlux.<\/p>\n<p>DGS (Domain Graph Service) \u2013 open source \u043f\u0440\u043e\u0435\u043a\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Netflix. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u0431\u044b\u043b \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 2020 \u0433\u043e\u0434\u0443 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0434\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 2019 \u0433\u043e\u0434\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f Netflix \u0435\u0449\u0435 \u0434\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 open source. \u041f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439, DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f production-ready \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>DGS <strong>\u2013<\/strong> \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GraphQL \u0432 Java. \u041e\u043d \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/graphql-java\/graphql-java\">graphql-java<\/a> \u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0439.<\/p>\n<h2>\u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0432\u044b\u0431\u043e\u0440\u0430 DGS Framework<\/h2>\n<p>DGS \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 <code>DataFetcher&lt;T><\/code> \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 <code>@DgsCodeRegistry<\/code> \u0438 <code>@DgsTypeDefinitionRegistry<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0443\u043c\u0435\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u0445\u0435\u043c\u044b GraphQLSchema, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0445\u0435\u043c\u0430\u043c\u0438 (\u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0438\u043b\u0438 \u0438\u0437 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439). \u0412 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u044b, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e. <\/p>\n<h2>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Spring Boot. \u0414\u043b\u044f 6.x \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Spring Boot 3 \u0438 JDK 17. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0441 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 Spring Boot, \u0442\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0414\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441\u043e Spring Boot 2.7 \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0440\u0435\u043b\u0438\u0437\u044b DGS 5.5.x. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Spring Boot 2.6, \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 5.4.x.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f GraphQL \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. <\/p>\n<h3>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c JDK 17, Spring Boot 3.0.11, WebFlux \u0438 Maven. <strong>\u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Spring Boot \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 DGS (\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 6.x).<\/strong><\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/24f\/60c\/1ab\/24f60c1abd17fe03faad6f8fb37a2c35.png\" alt=\"\" title=\"\" width=\"486\" height=\"810\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/24f\/60c\/1ab\/24f60c1abd17fe03faad6f8fb37a2c35.png\"\/><\/p>\n<div><figcaption>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 pom.xml:<\/p>\n<pre><code class=\"xml\"> &lt;dependencyManagement>       &lt;dependencies>           &lt;dependency>               &lt;groupId>com.netflix.graphql.dgs&lt;\/groupId>               &lt;artifactId>graphql-dgs-platform-dependencies&lt;\/artifactId>               &lt;!-- The DGS BOM\/platform dependency. This is the only place you set version of DGS -->               &lt;version>6.0.5&lt;\/version>               &lt;type>pom&lt;\/type>               &lt;scope>import&lt;\/scope>           &lt;\/dependency> &lt;!-- fix bug Could not initialize class com.netflix.graphql.dgs.DgsExecutionResult$Builder --> &lt;dependency>               &lt;groupId>com.graphql-java&lt;\/groupId>               &lt;artifactId>&lt;\/artifactId>               &lt;version>20.3&lt;\/version>           &lt;\/dependency>       &lt;\/dependencies>   &lt;\/dependencyManagement> &lt;dependency>     &lt;groupId>com.netflix.graphql.dgs&lt;\/groupId>     &lt;artifactId>graphql-dgs-webflux-starter&lt;\/artifactId> &lt;\/dependency> &lt;dependency>     &lt;groupId>org.projectlombok&lt;\/groupId>     &lt;artifactId>lombok&lt;\/artifactId>     &lt;version>1.18.28&lt;\/version> &lt;\/dependency><\/code><\/pre>\n<p>\u0412 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e graphql-dgs-webflux-starter, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b DGS Framework. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e\u043c Spring Boot, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c graphql-dgs-spring-boot-starter.<\/p>\n<p>\u0411\u043b\u043e\u043a com.graphql-java \u0432 &lt;dependencyManagement> \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 Could not initialize class com.netflix.graphql.dgs.DgsExecutionResult$Builder. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 com.graphql-java. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 dependencyManagement (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/Netflix\/dgs-framework\/issues\/1576\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<h3>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c java-\u043c\u043e\u0434\u0435\u043b\u0438 \u0438 data fetcher, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0423 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d (\u0434\u043b\u044f Gradle, \u0434\u043b\u044f Maven \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/github.com\/deweyjose\/graphqlcodegen\">\u043f\u043b\u0430\u0433\u0438\u043d \u043e\u0442 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438<\/a>). \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430: \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u0443\u0442\u044c \u043a \u0441\u0445\u0435\u043c\u0435 &lt;schemaPaths> \u0438 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 &lt;packageName>.<\/p>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0432\u043e\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/deweyjose\/graphqlcodegen\">\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 GitHub<\/a>.<\/p>\n<pre><code class=\"xml\"> &lt;dependency>     &lt;groupId>com.netflix.graphql.dgs.codegen&lt;\/groupId>     &lt;artifactId>graphql-dgs-codegen-client-core&lt;\/artifactId>     &lt;version>5.1.17&lt;\/version> &lt;\/dependency> &lt;plugin>     &lt;groupId>io.github.deweyjose&lt;\/groupId>     &lt;artifactId>graphqlcodegen-maven-plugin&lt;\/artifactId>     &lt;version>1.24&lt;\/version>     &lt;executions>         &lt;execution>             &lt;goals>                 &lt;goal>generate&lt;\/goal>             &lt;\/goals>         &lt;\/execution>     &lt;\/executions>     &lt;configuration>         &lt;schemaPaths>             &lt;param>src\/main\/resources\/schema\/blog.graphqls&lt;\/param>         &lt;\/schemaPaths>         &lt;packageName>com.example.blogdemo.generated&lt;\/packageName>     &lt;\/configuration> &lt;\/plugin> &lt;plugin>     &lt;groupId>org.codehaus.mojo&lt;\/groupId>     &lt;artifactId>build-helper-maven-plugin&lt;\/artifactId>     &lt;executions>         &lt;execution>             &lt;phase>generate-sources&lt;\/phase>             &lt;goals>                 &lt;goal>add-source&lt;\/goal>             &lt;\/goals>             &lt;configuration>                 &lt;sources>                     &lt;source>${project.build.directory}\/generated-sources&lt;\/source>                 &lt;\/sources>             &lt;\/configuration>         &lt;\/execution>     &lt;\/executions> &lt;\/plugin><\/code><\/pre>\n<h3>\u0421\u0445\u0435\u043c\u0430<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0441\u043b\u0435\u0434\u0443\u044f schema-first \u043f\u043e\u0434\u0445\u043e\u0434\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u043c GraphQL \u0441\u0445\u0435\u043c\u0443 \u0432 src\/resources\/schema\/blog.graphqls. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u0441 \u043f\u043e\u0441\u0442\u0430\u043c\u0438, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0438 \u0438\u0445 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"java\">type Query {     posts(titleFilter: String): [Post]     post(idFilter: Int!): Post }  type Post {     id: Int!     title: String     text: String     likes: Int     author: User!     comments: [Comment] }  type Comment {     id: Int!     text: String!     user: User!     post: Post! }  type User {     id: Int!     name: String!     email: String }<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0441\u0445\u0435\u043c\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430: \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u0432 (posts) \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043f\u043e \u0435\u0433\u043e id (post). \u0412 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 posts \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 titleFilter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0445\u0435\u043c\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u044d\u0442\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 (Post, Comment \u0438 User).<\/p>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 java-\u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u0441\u0445\u0435\u043c\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0445\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u043b\u0438\u0431\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 POJO \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432 blog.graphqls. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043b\u0430\u0441\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043f\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">@Getter @Setter @AllArgsConstructor @NoArgsConstructor public class Post {   private Integer id;   private String title;   private String text;   private Integer likes;   private Integer authorId; }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/projectlombok.org\/\">Lombok<\/a>.<\/p>\n<h3>Data Fetcher<\/h3>\n<p>Data fetcher \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041e\u043d\u0438 \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u042d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@DgsComponent<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, data fetcher \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">@DgsComponent @AllArgsConstructor public class PostDataFetcher {     private final PostService postService;      @DgsQuery     public Flux&lt;Post> posts(@InputArgument String titleFilter) {         if (titleFilter == null) {             return postService.getPosts();         }         return postService.getPostsByTitle(titleFilter);     }      @DgsQuery     public Mono&lt;Post> post(@InputArgument Integer idFilter) {         return postService.getPostById(idFilter);     } }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@DgsQuery<\/code> \u0438 \u043e\u043d\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432 \u0441\u0445\u0435\u043c\u0435 blog.graphqls . \u041a\u0440\u043e\u043c\u0435 <code>@DgsQuery<\/code> \u0432 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 GraphQL \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: <code>@DgsMutation<\/code> \u0438 <code>@DgsSubscription<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0432 data fetcher \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<h3>Data Loader \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u0432 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430. \u0418 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u044b \u0438 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e N \u043f\u043e\u0441\u0442\u0430\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f 1 \u0440\u0430\u0437 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043f\u043e\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u0432 \u0438 N \u0440\u0430\u0437 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0441 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430. \u0417\u043d\u0430\u0447\u0438\u0442, \u0432 \u0441\u0443\u043c\u043c\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c N+1 \u0437\u0430\u043f\u0440\u043e\u0441. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/04f\/ae6\/4e7\/04fae64e7aa353a752050b2e152d1735.png\" alt=\"\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1\" title=\"\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1\" width=\"936\" height=\"368\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/04f\/ae6\/4e7\/04fae64e7aa353a752050b2e152d1735.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043a\u0430\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1. \u041e\u043d\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u044f GraphQL, \u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 DGS \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f data loader \u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445\u0441\u044f id \u0430\u0432\u0442\u043e\u0440\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c id \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/452\/6fe\/7a9\/4526fe7a94addf3828ce9cd5495275c1.png\" alt=\"\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b N+1\" title=\"\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b N+1\" width=\"936\" height=\"294\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/452\/6fe\/7a9\/4526fe7a94addf3828ce9cd5495275c1.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b N+1<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 id. \u0418, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, data fetcher \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c data loader. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c <code>org.dataloader.BatchLoader<\/code> \u0438\u043b\u0438 <code>org.dataloader.MappedBatchLoader<\/code>. \u042d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u043a\u043b\u044e\u0447\u0430 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0442\u0438\u043f\u043e\u043c User \u043f\u043e \u0438\u0445 id \u0442\u0438\u043f\u0430 Integer, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>org.dataloader.BatchLoader&lt;Integer, User><\/code>.<\/p>\n<pre><code class=\"java\">@DgsDataLoader(name = \"users\") @AllArgsConstructor public class UserLoader implements BatchLoader&lt;Integer, User> {     private final UserService userService;     @Override     public CompletionStage&lt;List&lt;User>> load(List&lt;Integer> list) {         return CompletableFuture.supplyAsync(()->userService.getUserListByIds(list));     } }<\/code><\/pre>\n<p>\u0412 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434: <code>CompletionStage&lt;List> load(List keys)<\/code>. \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@DgsDataLoader<\/code>, \u0447\u0442\u043e\u0431\u044b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043b \u0435\u0433\u043e \u043a\u0430\u043a data loader. \u041e\u0434\u043d\u0430\u043a\u043e, \u0445\u043e\u0442\u044c data loader \u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 data fetcher.<\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0434\u043b\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u0432, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b\u043c, \u043d\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u0418\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f \u0442\u0438\u043f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0438 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"java\">@DgsDataLoader @AllArgsConstructor public class CommentLoader implements MappedBatchLoader&lt;Integer, List&lt;Comment>> {     private final CommentService commentService;     @Override     public CompletionStage&lt;Map&lt;Integer, List&lt;Comment>>> load(Set&lt;Integer> list) {         return CompletableFuture.supplyAsync(()->commentService.getCommentListByPostIds(new ArrayList&lt;>(list)));     } }<\/code><\/pre>\n<h3>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Data Loader<\/h3>\n<p>\u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e \u0432\u044b\u0448\u0435, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 data loader \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c data fetcher. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043a\u043e\u0439 data fetcher. \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d \u0438 \u0432 \u043f\u043e\u0441\u0442\u0435, \u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0436\u0435 \u0434\u0432\u0430.<\/p>\n<pre><code class=\"java\">@DgsComponent public class UserDataFetcher {     @DgsData(parentType = \"Post\", field = \"author\")     public CompletableFuture&lt;User> author(DgsDataFetchingEnvironment dfe) {         DataLoader&lt;Integer, User> dataLoader = dfe.getDataLoader(UserLoader.class);         Post post = dfe.getSource();         Integer id = post.getAuthorId();         return dataLoader.load(id);     }      @DgsData(parentType = \"Comment\", field = \"user\")     public CompletableFuture&lt;User> commentUser(DataFetchingEnvironment dfe) {         DataLoader&lt;Integer, User> dataLoader = dfe.getDataLoader(\"users\");         Comment comment = dfe.getSource();         Integer id = comment.getUserId();         return dataLoader.load(id);     } } <\/code><\/pre>\n<p>\u0412 <code>@DgsData<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0439 \u0442\u0438\u043f \u0438 \u043f\u043e\u043b\u0435, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f. \u0422\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 CompletableFuture, \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0430\u043c\u043e\u0435 \u0436\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u043e\u0433\u043e data fetcher \u0431\u0443\u0434\u0435\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0430 \u0447\u0435\u0440\u0435\u0437 data loader.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 data loader \u043c\u043e\u0436\u043d\u043e \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043c\u0435\u0442\u043e\u0434\u0430: <code>DataFetchingEnvironment<\/code> \u0438\u043b\u0438 <code>DgsDataFetchingEnvironment<\/code>. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>DgsDataFetchingEnvironment<\/code> \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 data loader \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u043a\u043b\u0430\u0441\u0441\u0430. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u0438\u043f\u043e-\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>DataFetchingEnvironment<\/code>, \u0442\u043e \u043f\u043e\u0438\u0441\u043a data loader \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0442\u044c \u044d\u0442\u043e \u0438\u043c\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 name \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@DgsDataLoader<\/code>.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>DgsDataFetchingEnvironment<\/code>, \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 <code>DataFetchingEnvironment<\/code>.<\/p>\n<h3>RxJava \u0432 Data Fetcher<\/h3>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432 data fetcher, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u043c data loader, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f CompletableFuture, \u0430 \u043d\u0435 Flux, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c. \u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438, DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 graphql-java. \u0410 graphql-java, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/github.com\/graphql-java\/graphql-java\/issues\/1636\">RxJava \/ WebFlux<\/a>. \u0418 DGS <a href=\"https:\/\/github.com\/Netflix\/dgs-framework\/issues\/376\">\u0441\u0430\u043c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 CompletableFuture \u0432 Mono\/Flux<\/a>.<\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a<\/h2>\n<p>DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 GraphiQL. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/localhost:8080\/graphiql\">http:\/\/localhost:8080\/graphiql<\/a> \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/73d\/1d7\/c4f\/73d1d7c4f75aa8e9490616902253e5bf.png\" width=\"3029\" height=\"1930\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/73d\/1d7\/c4f\/73d1d7c4f75aa8e9490616902253e5bf.png\"\/><\/figure>\n<h2>\u0412\u044b\u0432\u043e\u0434<\/h2>\n<p>DGS Framework \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GraphQL. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 DGS \u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0443\u043f\u0440\u043e\u0449\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043c\u043e\u0435\u043c <a href=\"https:\/\/github.com\/avisfy\/blog-demo\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043c\u0430\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 DGS Framework, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443, \u043c\u044b \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0438\u043c \u043d\u0430 \u043d\u0438\u0445.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/807013\/\"> https:\/\/habr.com\/ru\/articles\/807013\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u044b \u2013 \u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0430 \u0438 \u0412\u0438\u043a\u0442\u043e\u0440\u0438\u044f, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438 \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u00a0<a href=\"https:\/\/bftcom.com\/career\/\">\u0411\u0424\u0422-\u0425\u043e\u043b\u0434\u0438\u043d\u0433\u0435<\/a>. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u0445, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0438\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 WebFlux.<\/p>\n<p>DGS (Domain Graph Service) \u2013 open source \u043f\u0440\u043e\u0435\u043a\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Netflix. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u0431\u044b\u043b \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 2020 \u0433\u043e\u0434\u0443 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0434\u043b\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 2019 \u0433\u043e\u0434\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f Netflix \u0435\u0449\u0435 \u0434\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 open source. \u041f\u043e \u0441\u043b\u043e\u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439, DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f production-ready \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>DGS <strong>\u2013<\/strong> \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GraphQL \u0432 Java. \u041e\u043d \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/github.com\/graphql-java\/graphql-java\">graphql-java<\/a> \u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0439.<\/p>\n<h2>\u041f\u0440\u0438\u0447\u0438\u043d\u044b \u0432\u044b\u0431\u043e\u0440\u0430 DGS Framework<\/h2>\n<p>DGS \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 <code>DataFetcher&lt;T><\/code> \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 <code>@DgsCodeRegistry<\/code> \u0438 <code>@DgsTypeDefinitionRegistry<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0443\u043c\u0435\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u0445\u0435\u043c\u044b GraphQLSchema, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0445\u0435\u043c\u0430\u043c\u0438 (\u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0438\u043b\u0438 \u0438\u0437 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439). \u0412 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u044b, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e. <\/p>\n<h2>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Spring Boot. \u0414\u043b\u044f 6.x \u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Spring Boot 3 \u0438 JDK 17. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0441 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 Spring Boot, \u0442\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0414\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0441\u043e Spring Boot 2.7 \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0440\u0435\u043b\u0438\u0437\u044b DGS 5.5.x. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Spring Boot 2.6, \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 5.4.x.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f GraphQL \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u043a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. <\/p>\n<h3>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c JDK 17, Spring Boot 3.0.11, WebFlux \u0438 Maven. <strong>\u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Spring Boot \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 DGS (\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 6.x).<\/strong><\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<figure class=\"float\">\n<div><figcaption>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 pom.xml:<\/p>\n<pre><code class=\"xml\"> &lt;dependencyManagement>       &lt;dependencies>           &lt;dependency>               &lt;groupId>com.netflix.graphql.dgs&lt;\/groupId>               &lt;artifactId>graphql-dgs-platform-dependencies&lt;\/artifactId>               &lt;!-- The DGS BOM\/platform dependency. This is the only place you set version of DGS -->               &lt;version>6.0.5&lt;\/version>               &lt;type>pom&lt;\/type>               &lt;scope>import&lt;\/scope>           &lt;\/dependency> &lt;!-- fix bug Could not initialize class com.netflix.graphql.dgs.DgsExecutionResult$Builder --> &lt;dependency>               &lt;groupId>com.graphql-java&lt;\/groupId>               &lt;artifactId>&lt;\/artifactId>               &lt;version>20.3&lt;\/version>           &lt;\/dependency>       &lt;\/dependencies>   &lt;\/dependencyManagement> &lt;dependency>     &lt;groupId>com.netflix.graphql.dgs&lt;\/groupId>     &lt;artifactId>graphql-dgs-webflux-starter&lt;\/artifactId> &lt;\/dependency> &lt;dependency>     &lt;groupId>org.projectlombok&lt;\/groupId>     &lt;artifactId>lombok&lt;\/artifactId>     &lt;version>1.18.28&lt;\/version> &lt;\/dependency><\/code><\/pre>\n<p>\u0412 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e graphql-dgs-webflux-starter, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b DGS Framework. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e\u043c Spring Boot, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c graphql-dgs-spring-boot-starter.<\/p>\n<p>\u0411\u043b\u043e\u043a com.graphql-java \u0432 &lt;dependencyManagement> \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 Could not initialize class com.netflix.graphql.dgs.DgsExecutionResult$Builder. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 com.graphql-java. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 dependencyManagement (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/Netflix\/dgs-framework\/issues\/1576\">\u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<h3>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c java-\u043c\u043e\u0434\u0435\u043b\u0438 \u0438 data fetcher, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0423 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043f\u043b\u0430\u0433\u0438\u043d (\u0434\u043b\u044f Gradle, \u0434\u043b\u044f Maven \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <a href=\"https:\/\/github.com\/deweyjose\/graphqlcodegen\">\u043f\u043b\u0430\u0433\u0438\u043d \u043e\u0442 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438<\/a>). \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430: \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u0443\u0442\u044c \u043a \u0441\u0445\u0435\u043c\u0435 &lt;schemaPaths> \u0438 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 &lt;packageName>.<\/p>\n<p>\u041f\u043b\u0430\u0433\u0438\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0432\u043e\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/deweyjose\/graphqlcodegen\">\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432 GitHub<\/a>.<\/p>\n<pre><code class=\"xml\"> &lt;dependency>     &lt;groupId>com.netflix.graphql.dgs.codegen&lt;\/groupId>     &lt;artifactId>graphql-dgs-codegen-client-core&lt;\/artifactId>     &lt;version>5.1.17&lt;\/version> &lt;\/dependency> &lt;plugin>     &lt;groupId>io.github.deweyjose&lt;\/groupId>     &lt;artifactId>graphqlcodegen-maven-plugin&lt;\/artifactId>     &lt;version>1.24&lt;\/version>     &lt;executions>         &lt;execution>             &lt;goals>                 &lt;goal>generate&lt;\/goal>             &lt;\/goals>         &lt;\/execution>     &lt;\/executions>     &lt;configuration>         &lt;schemaPaths>             &lt;param>src\/main\/resources\/schema\/blog.graphqls&lt;\/param>         &lt;\/schemaPaths>         &lt;packageName>com.example.blogdemo.generated&lt;\/packageName>     &lt;\/configuration> &lt;\/plugin> &lt;plugin>     &lt;groupId>org.codehaus.mojo&lt;\/groupId>     &lt;artifactId>build-helper-maven-plugin&lt;\/artifactId>     &lt;executions>         &lt;execution>             &lt;phase>generate-sources&lt;\/phase>             &lt;goals>                 &lt;goal>add-source&lt;\/goal>             &lt;\/goals>             &lt;configuration>                 &lt;sources>                     &lt;source>${project.build.directory}\/generated-sources&lt;\/source>                 &lt;\/sources>             &lt;\/configuration>         &lt;\/execution>     &lt;\/executions> &lt;\/plugin><\/code><\/pre>\n<h3>\u0421\u0445\u0435\u043c\u0430<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0441\u043b\u0435\u0434\u0443\u044f schema-first \u043f\u043e\u0434\u0445\u043e\u0434\u0443, \u0434\u043e\u0431\u0430\u0432\u0438\u043c GraphQL \u0441\u0445\u0435\u043c\u0443 \u0432 src\/resources\/schema\/blog.graphqls. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u0441 \u043f\u043e\u0441\u0442\u0430\u043c\u0438, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0438 \u0438\u0445 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"java\">type Query {     posts(titleFilter: String): [Post]     post(idFilter: Int!): Post }  type Post {     id: Int!     title: String     text: String     likes: Int     author: User!     comments: [Comment] }  type Comment {     id: Int!     text: String!     user: User!     post: Post! }  type User {     id: Int!     name: String!     email: String }<\/code><\/pre>\n<p>\u042d\u0442\u0430 \u0441\u0445\u0435\u043c\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430: \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u0432 (posts) \u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043f\u043e \u0435\u0433\u043e id (post). \u0412 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 posts \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 titleFilter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0422\u0430\u043a\u0436\u0435 \u0432 \u0441\u0445\u0435\u043c\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u044d\u0442\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 (Post, Comment \u0438 User).<\/p>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 java-\u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u0441\u0445\u0435\u043c\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0445\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435, \u043b\u0438\u0431\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 POJO \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432 blog.graphqls. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043b\u0430\u0441\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043f\u043e\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"java\">@Getter @Setter @AllArgsConstructor @NoArgsConstructor public class Post {   private Integer id;   private String title;   private String text;   private Integer likes;   private Integer authorId; }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <a href=\"https:\/\/projectlombok.org\/\">Lombok<\/a>.<\/p>\n<h3>Data Fetcher<\/h3>\n<p>Data fetcher \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u041e\u043d\u0438 \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u042d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@DgsComponent<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, data fetcher \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">@DgsComponent @AllArgsConstructor public class PostDataFetcher {     private final PostService postService;      @DgsQuery     public Flux&lt;Post> posts(@InputArgument String titleFilter) {         if (titleFilter == null) {             return postService.getPosts();         }         return postService.getPostsByTitle(titleFilter);     }      @DgsQuery     public Mono&lt;Post> post(@InputArgument Integer idFilter) {         return postService.getPostById(idFilter);     } }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@DgsQuery<\/code> \u0438 \u043e\u043d\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432 \u0441\u0445\u0435\u043c\u0435 blog.graphqls . \u041a\u0440\u043e\u043c\u0435 <code>@DgsQuery<\/code> \u0432 DGS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 GraphQL \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: <code>@DgsMutation<\/code> \u0438 <code>@DgsSubscription<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0432 data fetcher \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<h3>Data Loader \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1<\/h3>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0442\u043e\u0432 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430. \u0418 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u044b \u0438 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e N \u043f\u043e\u0441\u0442\u0430\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f 1 \u0440\u0430\u0437 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043f\u043e\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u0432 \u0438 N \u0440\u0430\u0437 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0441 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430. \u0417\u043d\u0430\u0447\u0438\u0442, \u0432 \u0441\u0443\u043c\u043c\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c N+1 \u0437\u0430\u043f\u0440\u043e\u0441. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043a\u0430\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 N+1. \u041e\u043d\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u044f GraphQL, \u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043c\u043e\u0436\u0435\u0442 \u0440\u0435\u0448\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 DGS \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f data loader \u0438 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445\u0441\u044f id \u0430\u0432\u0442\u043e\u0440\u043e\u0432. \u0414\u0430\u043b\u0435\u0435 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c id \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u043e\u0432.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b N+1<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 id. \u0418, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, data fetcher \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c data loader. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c <code>org.dataloader.BatchLoader<\/code> \u0438\u043b\u0438 <code>org.dataloader.MappedBatchLoader<\/code>. \u042d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f\u044b<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-373380","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373380","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=373380"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373380\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=373380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=373380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=373380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}