{"id":468965,"date":"2025-07-29T15:00:32","date_gmt":"2025-07-29T15:00:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=468965"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=468965","title":{"rendered":"<span>\u0413\u0430\u0439\u0434 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e Spring GraphQL<\/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, \u0425\u0430\u0431\u0440! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 <strong>\u0414\u043c\u0438\u0442\u0440\u0438\u0439<\/strong>, \u0438 \u044f \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 <a href=\"https:\/\/t.me\/it_sense\" rel=\"noopener noreferrer nofollow\">SENSE<\/a> \u0441 10-\u043b\u0435\u0442\u043d\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u0417\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u044f \u0443\u0441\u043f\u0435\u043b \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0444\u0438\u043d\u0442\u0435\u0445-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432, \u043d\u043e GraphQL \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439\u00a0\u2014 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u00a0\u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441\u00a0\u043d\u0438\u043c \u0432\u00a0\u0440\u0430\u0431\u043e\u0442\u0435. \u0410\u00a0\u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0441\u044f, \u0442\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0442\u043e\u043b\u043a\u043e\u0432\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043f\u043e Spring-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 GraphQL \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0442\u0435\u043c\u0435, \u043d\u043e \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0433\u0430\u0439\u0434 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e, \u043a\u0430\u043a \u0438 \u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443.\u00a0<\/p>\n<p>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e: \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 GraphQL \u0441 \u043d\u0443\u043b\u044f. <strong>\u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/strong><\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/267\/345\/9a1\/2673459a1028d4a47ebb5e5ed42e6411.jpg\" width=\"990\" height=\"390\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/267\/345\/9a1\/2673459a1028d4a47ebb5e5ed42e6411.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/267\/345\/9a1\/2673459a1028d4a47ebb5e5ed42e6411.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 Spring Boot \u043f\u0440\u043e\u0435\u043a\u0442 <strong>\u043d\u0435 \u043d\u0438\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 3.5.3<\/strong> (Java 21 + Maven) \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>Spring for GraphQL\u00a0<\/p>\n<\/li>\n<li>\n<p>Lombok<\/p>\n<\/li>\n<li>\n<p>Spring Web<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/523\/648\/62a\/52364862a2a207d71be7787681192840.png\" width=\"1600\" height=\"847\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/523\/648\/62a\/52364862a2a207d71be7787681192840.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/523\/648\/62a\/52364862a2a207d71be7787681192840.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>pom.xml<\/code> \u043d\u0430\u043b\u0438\u0447\u0438\u0435 2-\u0445 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"java\">&lt;dependency&gt;    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;    &lt;artifactId&gt;spring-boot-starter-graphql&lt;\/artifactId&gt; &lt;\/dependency&gt; &lt;dependency&gt;    &lt;groupId&gt;org.springframework.graphql&lt;\/groupId&gt;    &lt;artifactId&gt;spring-graphql-test&lt;\/artifactId&gt;    &lt;scope&gt;test&lt;\/scope&gt; &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 <code>resources<\/code> \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u043f\u0430\u043f\u043a\u0438 <code>graphql<\/code><\/p>\n<\/li>\n<li>\n<p>\u0444\u0430\u0439\u043b\u0430 <code>application<\/code> (\u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 yml)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3f3\/797\/095\/3f37970950157a3660f30566ff1539a5.png\" width=\"760\" height=\"294\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3f3\/797\/095\/3f37970950157a3660f30566ff1539a5.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3f3\/797\/095\/3f37970950157a3660f30566ff1539a5.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0439\u00a0UI \u0441 GraphQL \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 <code>application.yml:<\/code><\/p>\n<pre><code class=\"java\">spring:    graphql:    graphiql:      enabled: true<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 <code>graphql<\/code> \u0444\u0430\u0439\u043b <code>query.graphqls.<\/code><\/p>\n<blockquote>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> .graphqls \u0438 .gqls \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 spring.graphql.schema.file-extensions<\/p>\n<\/blockquote>\n<p>\u0412 <code>query.graphqls<\/code> (\u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u2014 <code>\u201c\u0441\u0445\u0435\u043c\u0430 graphql\u201d<\/code>) \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 query \u043c\u0435\u0442\u043e\u0434 helloWorld:<\/p>\n<pre><code class=\"java\">type Query {    helloWorld: String }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u00a0 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"http:\/\/localhost:8080\/graphiql\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080\/graphiql<\/a>, \u0432\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d UI \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eba\/92e\/702\/eba92e702d246da308109b1ef1ea1412.png\" width=\"1600\" height=\"1061\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/eba\/92e\/702\/eba92e702d246da308109b1ef1ea1412.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/eba\/92e\/702\/eba92e702d246da308109b1ef1ea1412.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<div class=\"floating-image\">\n<figure class=\"float\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f0e\/278\/0f7\/f0e2780f7a876299948c6d3cd4d040b8.png\" width=\"200\" height=\"245\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f0e\/278\/0f7\/f0e2780f7a876299948c6d3cd4d040b8.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f0e\/278\/0f7\/f0e2780f7a876299948c6d3cd4d040b8.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e UI graphiql \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u043f\u0440\u044f\u043c\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0441\u0442\u043e\u0438\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043f\u043e \u043e\u0431\u0445\u043e\u0434\u0443 \u0438\u043b\u0438 postman.<\/p>\n<\/div>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ca\/833\/9fd\/6ca8339fd2953371d59d013cf817a1ff.png\" width=\"1600\" height=\"1017\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/6ca\/833\/9fd\/6ca8339fd2953371d59d013cf817a1ff.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ca\/833\/9fd\/6ca8339fd2953371d59d013cf817a1ff.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 <code>helloWorld<\/code>:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/24d\/140\/a8b\/24d140a8b29158387364277a3f59cecc.png\" width=\"1600\" height=\"310\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/24d\/140\/a8b\/24d140a8b29158387364277a3f59cecc.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/24d\/140\/a8b\/24d140a8b29158387364277a3f59cecc.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p><strong>\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e! \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \ud83d\ude42<\/strong><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e @QueryMapping<\/h2>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 <code>helloWorld<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 <code>null<\/code>, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.\u00a0<\/p>\n<p>\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 <code>Spring<\/code> \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b <code>REST API<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u043e\u0433\u043e\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c <code>helloWorld<\/code>:<\/p>\n<pre><code class=\"java\">@Controller public class HelloWorldController {      @QueryMapping    public String helloWorld() {        return \"HI!\";    } }<\/code><\/pre>\n<p>\u0418\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 \u0441\u0445\u0435\u043c\u044b graphql \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@QueryMapping<\/code>.\u00a0<\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"java\">{    \"data\": {        \"helloWorld\": \"HI!\"    } }<\/code><\/pre>\n<p><strong>\u0423\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c String \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 String \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u00ab!\u00bb \u0432 \u0441\u0445\u0435\u043c\u0435 graphQL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0445\u0435\u043c\u0443 graphql \u0438 Controller.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"java\">type Query {    helloWorld(text: String!): String! }<\/code><\/pre>\n<pre><code class=\"java\">@QueryMapping public String helloWorld(@Argument(name = \"text\") String msg) {    return msg; }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0432 <code>@Argument<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>name<\/code>. \u0415\u0441\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>@Argument<\/code> \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e @MutationMapping<\/h2>\n<p>\u0412 GraphQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u0442\u0440\u0438 \u0442\u0438\u043f\u0430:\u00a0<\/p>\n<ul>\n<li>\n<p>mutation;<\/p>\n<\/li>\n<li>\n<p>query;<\/p>\n<\/li>\n<li>\n<p>subscription (\u0435\u0433\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c).\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0443\u0442\u0430\u0446\u0438\u0438 (mutation) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u044b (query) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0<\/p>\n<p><strong>\u0425\u043e\u0442\u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0435 \u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430. <\/strong>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <code>mutation.graphqls<\/code> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0443\u0442\u0430\u0446\u0438\u0439 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0445\u0435\u043c\u0435:<\/p>\n<pre><code class=\"java\">type Mutation {    mutationHelloWorld(text: String!): String! }<\/code><\/pre>\n<p>\u00a0\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440:<\/p>\n<pre><code class=\"java\">private String data = \"Hello, World!\";   @QueryMapping public String helloWorld(@Argument String text) {    return text + \" \" + data; }   @MutationMapping public String mutationHelloWorld(@Argument String text) {    data = text;    return data; }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c <code>mutation<\/code> \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>data<\/code>, \u0430 <code>query<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 + <code>data<\/code>.<\/p>\n<h2>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 @QueryMapping \u0438 @MutationMapping<\/h2>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/42d\/c63\/17a\/42dc6317a013a0b97f71660905279786.png\" width=\"524\" height=\"524\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/42d\/c63\/17a\/42dc6317a013a0b97f71660905279786.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/42d\/c63\/17a\/42dc6317a013a0b97f71660905279786.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<pre><code class=\"java\">@SpringBootTest @AutoConfigureGraphQlTester public class HelloWorldControllerTets {     @Autowired    protected GraphQlTester graphQlTester;     @Test    void queryTest() {         String query = \"\"\"                    query MyQuery {                      helloWorld(text: \"123\")                    }                \"\"\";        String response = graphQlTester.document(query).execute().path(\"helloWorld\").entity(String.class).get();        assertThat(response).isEqualTo(\"123 Hello, World!\");    }     @Test    void mutationTest() {        String query = \"\"\"                    mutation MyMutation {                      mutationHelloWorld(text: \"text\")                    }                \"\"\";        String response = graphQlTester.document(query).execute().path(\"mutationHelloWorld\").entity(String.class).get();        assertThat(response).isEqualTo(\"text\");    } }<\/code><\/pre>\n<p>\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0442\u0435\u0441\u0442 <code>mutationTest<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0434\u043e queryTest, \u0442\u043e queryTest \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u0441\u044f. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e <code>mutationTest<\/code> \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 <code>queryTest<\/code>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0433\u0430\u0439\u0434\u0430 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Spring GraphQL: \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u0443\u0442\u0430\u0446\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b::<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 DataLoader \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Spring Security \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Spring.<\/p>\n<\/li>\n<\/ul>\n<p><strong>Spring GraphQL<\/strong>\u00a0\u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c GraphQL \u0441 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e\u043c Spring, \u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u0440\u0430\u0441\u043a\u0440\u043e\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<p><em>\u0410 \u043a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u043e\u0432\u0430\u043b\u0438 GraphQL \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c? \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0438 \u0433\u043e\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043d\u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u044b!<\/em><\/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\/932054\/\"> https:\/\/habr.com\/ru\/articles\/932054\/<\/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, \u0425\u0430\u0431\u0440! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 <strong>\u0414\u043c\u0438\u0442\u0440\u0438\u0439<\/strong>, \u0438 \u044f \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 <a href=\"https:\/\/t.me\/it_sense\" rel=\"noopener noreferrer nofollow\">SENSE<\/a> \u0441 10-\u043b\u0435\u0442\u043d\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u0417\u0430 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u044f \u0443\u0441\u043f\u0435\u043b \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0444\u0438\u043d\u0442\u0435\u0445-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432, \u043d\u043e GraphQL \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439\u00a0\u2014 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u00a0\u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441\u00a0\u043d\u0438\u043c \u0432\u00a0\u0440\u0430\u0431\u043e\u0442\u0435. \u0410\u00a0\u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0441\u044f, \u0442\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u0442\u043e\u043b\u043a\u043e\u0432\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043f\u043e Spring-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 GraphQL \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u0442\u0435\u043c\u0435, \u043d\u043e \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0433\u0430\u0439\u0434 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e, \u043a\u0430\u043a \u0438 \u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443.\u00a0<\/p>\n<p>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e: \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 GraphQL \u0441 \u043d\u0443\u043b\u044f. <strong>\u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/strong><\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h2>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 Spring Boot \u043f\u0440\u043e\u0435\u043a\u0442 <strong>\u043d\u0435 \u043d\u0438\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 3.5.3<\/strong> (Java 21 + Maven) \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>Spring for GraphQL\u00a0<\/p>\n<\/li>\n<li>\n<p>Lombok<\/p>\n<\/li>\n<li>\n<p>Spring Web<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 <code>pom.xml<\/code> \u043d\u0430\u043b\u0438\u0447\u0438\u0435 2-\u0445 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"java\">&lt;dependency&gt;    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;    &lt;artifactId&gt;spring-boot-starter-graphql&lt;\/artifactId&gt; &lt;\/dependency&gt; &lt;dependency&gt;    &lt;groupId&gt;org.springframework.graphql&lt;\/groupId&gt;    &lt;artifactId&gt;spring-graphql-test&lt;\/artifactId&gt;    &lt;scope&gt;test&lt;\/scope&gt; &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 <code>resources<\/code> \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>\u043f\u0430\u043f\u043a\u0438 <code>graphql<\/code><\/p>\n<\/li>\n<li>\n<p>\u0444\u0430\u0439\u043b\u0430 <code>application<\/code> (\u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 yml)<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0439\u00a0UI \u0441 GraphQL \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 <code>application.yml:<\/code><\/p>\n<pre><code class=\"java\">spring:    graphql:    graphiql:      enabled: true<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0435 <code>graphql<\/code> \u0444\u0430\u0439\u043b <code>query.graphqls.<\/code><\/p>\n<blockquote>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> .graphqls \u0438 .gqls \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 spring.graphql.schema.file-extensions<\/p>\n<\/blockquote>\n<p>\u0412 <code>query.graphqls<\/code> (\u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u2014 <code>\u201c\u0441\u0445\u0435\u043c\u0430 graphql\u201d<\/code>) \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 query \u043c\u0435\u0442\u043e\u0434 helloWorld:<\/p>\n<pre><code class=\"java\">type Query {    helloWorld: String }<\/code><\/pre>\n<p>\u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u00a0 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"http:\/\/localhost:8080\/graphiql\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080\/graphiql<\/a>, \u0432\u0430\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d UI \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:<\/p>\n<figure class=\"full-width\"><\/figure>\n<div class=\"floating-image\">\n<figure class=\"float\"><\/figure>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e UI graphiql \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u043f\u0440\u044f\u043c\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0441\u0442\u043e\u0438\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043f\u043e \u043e\u0431\u0445\u043e\u0434\u0443 \u0438\u043b\u0438 postman.<\/p>\n<\/div>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 <code>helloWorld<\/code>:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><strong>\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e! \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \ud83d\ude42<\/strong><\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e @QueryMapping<\/h2>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 <code>helloWorld<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 <code>null<\/code>, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.\u00a0<\/p>\n<p>\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 <code>Spring<\/code> \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b <code>REST API<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u043e\u0433\u043e\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c <code>helloWorld<\/code>:<\/p>\n<pre><code class=\"java\">@Controller public class HelloWorldController {      @QueryMapping    public String helloWorld() {        return \"HI!\";    } }<\/code><\/pre>\n<p>\u0418\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0437 \u0441\u0445\u0435\u043c\u044b graphql \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@QueryMapping<\/code>.\u00a0<\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"java\">{    \"data\": {        \"helloWorld\": \"HI!\"    } }<\/code><\/pre>\n<p><strong>\u0423\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434:<\/strong><\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c String \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u043e\u0442\u0432\u0435\u0442\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 String \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u00ab!\u00bb \u0432 \u0441\u0445\u0435\u043c\u0435 graphQL. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0445\u0435\u043c\u0443 graphql \u0438 Controller.<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"java\">type Query {    helloWorld(text: String!): String! }<\/code><\/pre>\n<pre><code class=\"java\">@QueryMapping public String helloWorld(@Argument(name = \"text\") String msg) {    return msg; }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0432 <code>@Argument<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>name<\/code>. \u0415\u0441\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>@Argument<\/code> \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e @MutationMapping<\/h2>\n<p>\u0412 GraphQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u0442\u0440\u0438 \u0442\u0438\u043f\u0430:\u00a0<\/p>\n<ul>\n<li>\n<p>mutation;<\/p>\n<\/li>\n<li>\n<p>query;<\/p>\n<\/li>\n<li>\n<p>subscription (\u0435\u0433\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c).\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0443\u0442\u0430\u0446\u0438\u0438 (mutation) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u044b (query) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0<\/p>\n<p><strong>\u0425\u043e\u0442\u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0435 \u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430. <\/strong>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430.\u00a0<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b <code>mutation.graphqls<\/code> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0443\u0442\u0430\u0446\u0438\u0439 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0445\u0435\u043c\u0435:<\/p>\n<pre><code class=\"java\">type Mutation {    mutationHelloWorld(text: String!): String! }<\/code><\/pre>\n<p>\u00a0\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440:<\/p>\n<pre><code class=\"java\">private String data = \"Hello, World!\";   @QueryMapping public String helloWorld(@Argument String text) {    return text + \" \" + data; }   @MutationMapping public String mutationHelloWorld(@Argument String text) {    data = text;    return data; }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c <code>mutation<\/code> \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>data<\/code>, \u0430 <code>query<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 + <code>data<\/code>.<\/p>\n<h2>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 @QueryMapping \u0438 @MutationMapping<\/h2>\n<figure class=\"full-width\"><\/figure>\n<pre><code class=\"java\">@SpringBootTest @AutoConfigureGraphQlTester public class HelloWorldControllerTets {     @Autowired    protected GraphQlTester graphQlTester;     @Test    void queryTest() {         String query = \"\"\"                    query MyQuery {                      helloWorld(text: \"123\")                    }                \"\"\";        String response = graphQlTester.document(query).execute().path(\"helloWorld\").entity(String.class).get();        assertThat(response).isEqualTo(\"123 Hello, World!\");    }     @Test    void mutationTest() {        String query = \"\"\"                    mutation MyMutation {                      mutationHelloWorld(text: \"text\")                    }                \"\"\";        String response = graphQlTester.document(query).execute().path(\"mutationHelloWorld\").entity(String.class).get();        assertThat(response).isEqualTo(\"text\");    } }<\/code><\/pre>\n<p>\u041e\u0436\u0438\u0434\u0430\u0435\u043c\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0442\u0435\u0441\u0442 <code>mutationTest<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0434\u043e queryTest, \u0442\u043e queryTest \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u0441\u044f. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e <code>mutationTest<\/code> \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 <code>queryTest<\/code>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0433\u0430\u0439\u0434\u0430 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Spring GraphQL: \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u0443\u0442\u0430\u0446\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b::<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 DataLoader \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Spring Security \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Spring.<\/p>\n<\/li>\n<\/ul>\n<p><strong>Spring GraphQL<\/strong>\u00a0\u2014 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c GraphQL \u0441 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e\u043c Spring, \u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u0440\u0430\u0441\u043a\u0440\u043e\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<p><em>\u0410 \u043a\u0430\u043a \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u043e\u0432\u0430\u043b\u0438 GraphQL \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c? \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0438 \u0433\u043e\u0442\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043d\u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u044b!<\/em><\/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\/932054\/\"> https:\/\/habr.com\/ru\/articles\/932054\/<\/a><br \/><\/br><\/br><\/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-468965","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468965","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=468965"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/468965\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}