首页 > 其他分享 >graphql .net

graphql .net

时间:2022-08-16 13:36:59浏览次数:83  
标签:7.0 json GraphQL var graphql net Hello

安装
GraphQL 7.0.0
GraphQL.SystemTextJson 7.0.0

HelloWorld

public class Program
    {
        public static async Task Main(string[] args)
        {
            var schema = Schema.For(@"
      type Query {
        hello: String
      }
    ");
            var json = await schema.ExecuteAsync(_ =>
            {
                _.Query = "{ hello }";
                _.Root = new { Hello = "Hello World!" };
            });

            Console.WriteLine(json);
        }
    }

[参考]
GraphQL.NET

标签:7.0,json,GraphQL,var,graphql,net,Hello
From: https://www.cnblogs.com/ives/p/16591219.html

相关文章