{"id":349832,"date":"2023-07-05T21:01:13","date_gmt":"2023-07-05T21:01:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=349832"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=349832","title":{"rendered":"<span>GraphQL \u0432 .NET: \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/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<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/www.c-sharpcorner.com\/article\/graphql-in-net-introduction\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438, \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d GraphQL \u0438 \u0432 \u0447\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 GraphQL \u0438 REST. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GraphQL.<\/p>\n<h3>GraphQL \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h3>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GraphQL \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 .NET, \u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/chillicream.com\/docs\/hotchocolate\/v13\">Hot Chocolate<\/a>.<\/p>\n<p>\u042f\u0432\u043b\u044f\u044f\u0441\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c graphQL, Hot Chocolate \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043d\u0430\u0441 \u043e\u0442 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0441\u0443\u0449\u0438 graphQL.<\/p>\n<p>PS: \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <a href=\"https:\/\/github.com\/TuralSuleymani\/WorkingWithGraphQL\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 graphQL<\/a> \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c GraphQL \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435: (\u043f\u0440\u043e\u0435\u043a\u0442 <code>001_GraphQLEssentials<\/code> \u0438\u0437 <a href=\"https:\/\/github.com\/TuralSuleymani\/WorkingWithGraphQL\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>)<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"http:\/\/asp.net\">asp.net<\/a> core \u0438\u0437 Visual Studio. (\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Visual Studio, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 &#171;dotnet new web&#187; \u0432 \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u043f\u043a\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>hotchocolate<\/code>, \u043d\u0430\u0431\u0440\u0430\u0432 <code>install-package hotchocolate.aspnetcore<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b <code>Program.cs<\/code> \u0438 \u0432\u043d\u0435\u0441\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">using _001_GraphQLEssentials.Queries;  namespace _001_GraphQLEssentials {     public class Program     {         public static void Main(string[] args)         {             var builder = WebApplication.CreateBuilder(args);             builder.Services.AddGraphQLServer()                 .AddQueryType&lt;Query>();              var app = builder.Build();              app.MapGraphQL();              app.Run();         }     } }<\/code><\/pre>\n<p><code>AddGraphQLServer()<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 Hotchocoloate graphQL \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 graphQL. \u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>AddQueryType()<\/code> \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0438\u043f, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 graphQL \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>MapGraphQL()<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f <code>\/graphql<\/code>.<\/p>\n<p>4) \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u043c\u0435\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<pre><code class=\"cs\">public class Customer     {         public int Id { get; set; }         public string Name { get; set; }         public string Email { get; set; }         public List&lt;Card> Cards { get; set; }     }   public class Card     {         public int Id { get; set; }         public string Number { get; set; }         public string CVC { get; set; }         public string ExpiryDate { get; set; }     }<\/code><\/pre>\n<p>5) \u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>GetCustomers<\/code>.<\/p>\n<pre><code class=\"cs\">namespace _001_GraphQLEssentials.Queries {     public class Query     {         public IEnumerable&lt;Customer> GetCustomers()         {             return new                 Customer[]             {                 new Customer{ Id = 1, Email = \"bakihanma@gmail.com\", Name = \"Baki\",                 Cards = new List&lt;Card>()                 {                     new Card{ Number = \"1234-1234-4444\", CVC=\"653\", ExpiryDate=\"08\/28\", Id = 1},                     new Card{ Number = \"7766-1234-4444\", CVC=\"765\", ExpiryDate=\"08\/26\", Id = 2},                 } },                 new Customer{ Id = 2, Email = \"hanayamakaoru@gmail.com\", Name = \"Hanamayama\",                  Cards = new List&lt;Card>()                 {                     new Card{ Number = \"7878-3333-4444\", CVC=\"222\", ExpiryDate=\"08\/28\", Id = 3},                     new Card{ Number = \"7766-6789-1234\", CVC=\"111\", ExpiryDate=\"08\/26\", Id = 4},                 } },                 new Customer{ Id = 3, Email = \"orochi@gmail.com\", Name = \"Doppo\",                  Cards = new List&lt;Card>()                 {                     new Card{ Number = \"1234-1234-5456\", CVC=\"123\", ExpiryDate=\"08\/28\", Id = 5},                     new Card{ Number = \"8888-4444-4532\", CVC=\"345\", ExpiryDate=\"08\/26\", Id = 6},                 } },                 new Customer{ Id = 4, Email = \"dorian@gmail.com\", Name = \"Dorian\", Cards = new List&lt;Card>()                 {                     new Card{ Number = \"8989-5555-4444\", CVC=\"567\", ExpiryDate=\"08\/28\", Id = 7},                     new Card{ Number = \"7766-6666-4444\", CVC=\"789\", ExpiryDate=\"08\/26\", Id = 8},                 } },             };         }     } }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2e2\/7d1\/8ae\/2e27d18aebcc42de899f098085dc13dc.png\" width=\"700\" height=\"396\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2e2\/7d1\/8ae\/2e27d18aebcc42de899f098085dc13dc.png\"\/><\/figure>\n<p>\u0412\u044b\u0431\u0440\u0430\u0432 &#171;<strong>Create document<\/strong>&#187; (\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442) \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 <code>\/graphql<\/code>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0435\u0431-\u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f &#171;banana Cake Pop&#187;, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6f3\/46d\/747\/6f346d747454d37cbca759fc4f2ee569.png\" width=\"700\" height=\"442\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f3\/46d\/747\/6f346d747454d37cbca759fc4f2ee569.png\"\/><\/figure>\n<p>\u0418\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 &#171;Schema reference&#187; \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c &#171;\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e&#187; \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c &#171;\u0438\u043c\u044f&#187; \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0435 <code>CustomerQuery: customers: name<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cca\/ae6\/816\/ccaae6816353b917bc6e9c8dcfed7287.png\" width=\"700\" height=\"229\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cca\/ae6\/816\/ccaae6816353b917bc6e9c8dcfed7287.png\"\/><\/figure>\n<p>\u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c <code>CustomerQuery<\/code> \u0432 <code>AddQueryType()<\/code><strong> <\/strong>\u0432 Program.cs, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 <code>customers: name<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4a7\/d88\/cf8\/4a7d88cf8bc7b7dc675cc5ed4943bad6.png\" width=\"700\" height=\"247\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a7\/d88\/cf8\/4a7d88cf8bc7b7dc675cc5ed4943bad6.png\"\/><\/figure>\n<h3>\u041a\u0435\u0439\u0441\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/136\/669\/d81\/136669d81aa9f923cfecc0e58de7ea26.png\" width=\"700\" height=\"197\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/136\/669\/d81\/136669d81aa9f923cfecc0e58de7ea26.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/303\/93c\/c03\/30393cc03bc7b369a3bd6b4fc8665a00.png\" width=\"700\" height=\"384\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/303\/93c\/c03\/30393cc03bc7b369a3bd6b4fc8665a00.png\"\/><\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0444\u043e\u0440\u043c\u0430\u0442 graphQL \u043e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 JSON. \u041d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 JSON, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439.<\/p>\n<p>\u0412 GraphQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 2 \u0433\u0440\u0443\u043f\u043f\u044b.<\/p>\n<ol>\n<li>\n<p><strong>Query<\/strong> = HTTP GET \u0432 REST<\/p>\n<\/li>\n<li>\n<p><strong>Mutation<\/strong> = POST, PUT, DELETE, PATCH.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 GraphQL \u2014 \u044d\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 <strong>HTTP POST<\/strong>.\u00a0 HTTP POST \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043c\u0443\u0442\u0430\u0446\u0438\u0439: Queries \u0438 Mutations.<\/p>\n<p>HTTP GET \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f Persisted Queries (\u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432).<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e GraphQL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f<strong>\u00a0 transport agnostic (\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e-\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439)<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. \u0414\u043b\u044f GraphQL \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HTTP, \u0441\u043e\u043a\u0435\u0442, grpc \u0438 \u0442.\u0434. <\/p>\n<p>12 \u0438\u044e\u043b\u044f \u0432 OTUS \u043f\u0440\u043e\u0439\u0434\u0435\u0442 <a href=\"https:\/\/otus.pw\/CNds\/\">\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a<\/a>, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 .Net.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a \u0431\u0430\u0440\u044c\u0435\u0440\u044b, \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (ManualResetEvent\/AutoResetEvent), \u043f\u043e\u0442\u043e\u043a\u043e-\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0438 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c\u044b\u0435). \u041e\u0431\u0441\u0443\u0434\u0438\u043c, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u0435\u0437 Thread.Sleep, \u0433\u0434\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e.<\/p>\n<p>\u0423\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0443\u0440\u043e\u0432\u043d\u044f Junior \u0438 Middle, \u043a\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b .Net, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Thread.Sleep.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/otus.pw\/CNds\/\">\u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a<\/a><\/p>\n<\/li>\n<\/ul>\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\/companies\/otus\/articles\/746126\/\"> https:\/\/habr.com\/ru\/companies\/otus\/articles\/746126\/<\/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<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/www.c-sharpcorner.com\/article\/graphql-in-net-introduction\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438, \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d GraphQL \u0438 \u0432 \u0447\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 GraphQL \u0438 REST. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u044b \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GraphQL.<\/p>\n<h3>GraphQL \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h3>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GraphQL \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 .NET, \u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/chillicream.com\/docs\/hotchocolate\/v13\">Hot Chocolate<\/a>.<\/p>\n<p>\u042f\u0432\u043b\u044f\u044f\u0441\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c graphQL, Hot Chocolate \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u0442 \u043d\u0430\u0441 \u043e\u0442 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0441\u0443\u0449\u0438 graphQL.<\/p>\n<p>PS: \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <a href=\"https:\/\/github.com\/TuralSuleymani\/WorkingWithGraphQL\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 graphQL<\/a> \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c GraphQL \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435: (\u043f\u0440\u043e\u0435\u043a\u0442 <code>001_GraphQLEssentials<\/code> \u0438\u0437 <a href=\"https:\/\/github.com\/TuralSuleymani\/WorkingWithGraphQL\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>)<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"http:\/\/asp.net\">asp.net<\/a> core \u0438\u0437 Visual Studio. (\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 Visual Studio, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 &#171;dotnet new web&#187; \u0432 \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u043f\u043a\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>hotchocolate<\/code>, \u043d\u0430\u0431\u0440\u0430\u0432 <code>install-package hotchocolate.aspnetcore<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b <code>Program.cs<\/code> \u0438 \u0432\u043d\u0435\u0441\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cs\">using _001_GraphQLEssentials.Queries;  namespace _001_GraphQLEssentials {     public class Program     {         public static void Main(string[] args)         {             var builder = WebApplication.CreateBuilder(args);             builder.Services.AddGraphQLServer()                 .AddQueryType&lt;Query>();              var app = builder.Build();              app.MapGraphQL();              app.Run();         }     } }<\/code><\/pre>\n<p><code>AddGraphQLServer()<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 Hotchocoloate graphQL \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 graphQL. \u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>AddQueryType()<\/code> \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0442\u0438\u043f, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 graphQL \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>MapGraphQL()<\/code>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f <code>\/graphql<\/code>.<\/p>\n<p>4) \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u043c\u0435\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<pre><code class=\"cs\">public class Customer     {         public int Id { get; set; }         public string Name { get; set; }         public string Email { get; set; }         public List&lt;Card> Cards { get; set; }     }   public class Card     {         public int Id { get; set; }         public string Number { get; set; }         public string CVC { get; set; }         public string ExpiryDate { get; set; }     }<\/code><\/pre>\n<p>5) \u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>GetCustomers<\/code>.<\/p>\n<pre><code class=\"cs\">namespace _001_GraphQLEssentials.Queries {     public class Query     {         public IEnumerable&lt;Customer> GetCustomers()         {             return new                 Customer[]             {                 new Customer{ Id = 1, Email = \"bakihanma@gmail.com\", Name = \"Baki\",                 Cards = new List&lt;Card>()                 {                     new Card{ Number = \"1234-1234-4444\", CVC=\"653\", ExpiryDate=\"08\/28\", Id = 1},                     new Card{ Number = \"7766-1234-4444\", CVC=\"765\", ExpiryDate=\"08\/26\", Id = 2},                 } },                 new Customer{ Id = 2, Email = \"hanayamakaoru@gmail.com\", Name = \"Hanamayama\",                  Cards = new List&lt;Card>()                 {                     new Card{ Number = \"7878-3333-4444\", CVC=\"222\", ExpiryDate=\"08\/28\", Id = 3},                     new Card{ Number = \"7766-6789-1234\", CVC=\"111\", ExpiryDate=\"08\/26\", Id = 4},                 } },                 new Customer{ Id = 3, Email = \"orochi@gmail.com\", Name = \"Doppo\",                  Cards = new List&lt;Card>()                 {                     new Card{ Number = \"1234-1234-5456\", CVC=\"123\", ExpiryDate=\"08\/28\", Id = 5},                     new Card{ Number = \"8888-4444-4532\", CVC=\"345\", ExpiryDate=\"08\/26\", Id = 6},                 } },                 new Customer{ Id = 4, Email = \"dorian@gmail.com\", Name = \"Dorian\", Cards = new List&lt;Card>()                 {                     new Card{ Number = \"8989-5555-4444\", CVC=\"567\", ExpiryDate=\"08\/28\", Id = 7},                     new Card{ Number = \"7766-6666-4444\", CVC=\"789\", ExpiryDate=\"08\/26\", Id = 8},                 } },             };         }     } }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u0431\u0440\u0430\u0432 &#171;<strong>Create document<\/strong>&#187; (\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442) \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 <code>\/graphql<\/code>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0435\u0431-\u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f &#171;banana Cake Pop&#187;, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 &#171;Schema reference&#187; \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c &#171;\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e&#187; \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u044d\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c &#171;\u0438\u043c\u044f&#187; \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0435 <code>CustomerQuery: customers: name<\/code>.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c <code>CustomerQuery<\/code> \u0432 <code>AddQueryType()<\/code><strong> <\/strong>\u0432 Program.cs, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 <code>customers: name<\/code>.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u041a\u0435\u0439\u0441\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0444\u043e\u0440\u043c\u0430\u0442 graphQL \u043e\u0442\u0447\u0430\u0441\u0442\u0438 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 JSON. \u041d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 JSON, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439.<\/p>\n<p>\u0412 GraphQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 2 \u0433\u0440\u0443\u043f\u043f\u044b.<\/p>\n<ol>\n<li>\n<p><strong>Query<\/strong> = HTTP GET \u0432 REST<\/p>\n<\/li>\n<li>\n<p><strong>Mutation<\/strong> = POST, PUT, DELETE, PATCH.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 GraphQL \u2014 \u044d\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 <strong>HTTP POST<\/strong>.\u00a0 HTTP POST \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043c\u0443\u0442\u0430\u0446\u0438\u0439: Queries \u0438 Mutations.<\/p>\n<p>HTTP GET \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f Persisted Queries (\u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432).<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e GraphQL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f<strong>\u00a0 transport agnostic (\u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u043e-\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439)<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430. \u0414\u043b\u044f GraphQL \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c HTTP, \u0441\u043e\u043a\u0435\u0442, grpc \u0438 \u0442.\u0434. <\/p>\n<p>12 \u0438\u044e\u043b\u044f \u0432 OTUS \u043f\u0440\u043e\u0439\u0434\u0435\u0442 <a href=\"https:\/\/otus.pw\/CNds\/\">\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a<\/a>, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 .Net.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u043a\u0430\u043a \u0431\u0430\u0440\u044c\u0435\u0440\u044b, \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (ManualResetEvent\/AutoResetEvent), \u043f\u043e\u0442\u043e\u043a\u043e-\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 (\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0438 \u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c\u044b\u0435). \u041e\u0431\u0441\u0443\u0434\u0438\u043c, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u0435\u0437 Thread.Sleep, \u0433\u0434\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e.<\/p>\n<p>\u0423\u0440\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0443\u0440\u043e\u0432\u043d\u044f Junior \u0438 Middle, \u043a\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b .Net, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Thread.Sleep.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/otus.pw\/CNds\/\">\u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a<\/a><\/p>\n<\/li>\n<\/ul>\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\/companies\/otus\/articles\/746126\/\"> https:\/\/habr.com\/ru\/companies\/otus\/articles\/746126\/<\/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-349832","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349832","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=349832"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349832\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}