安装
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