首页 > 其他分享 >graphql .net

graphql .net

时间:2022-10-07 18:07:25浏览次数:60  
标签:7.0 json GraphQL var graphql net Hello schema

安装
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);
}
}

客户端工具
altair_4.6.2_x64_win 类似postman

[参考]
​​​GraphQL.NET​

留待后查,同时方便他人



标签:7.0,json,GraphQL,var,graphql,net,Hello,schema
From: https://blog.51cto.com/ives/5734769

相关文章