Skip to content

Instantly share code, notes, and snippets.

@koistya
Last active June 9, 2017 17:59
Show Gist options
  • Select an option

  • Save koistya/aff5ef003d5e137a165c26bba2b224f7 to your computer and use it in GitHub Desktop.

Select an option

Save koistya/aff5ef003d5e137a165c26bba2b224f7 to your computer and use it in GitHub Desktop.
GraphQL with .NET Core, C#
namespace Example
{
public class RootQueryType
{
public Func<string> Hello { get; set; } = () => "world";
}
public class Schema
{
public RootQueryType Query { get; set; }
}
}
namespace Example
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.UseGraphQL<Schema>();
}
public static void Main()
{
var host = new WebHostBuilder()
.UseKestrel()
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
@mahald
Copy link

mahald commented Jun 9, 2017

i can't finde the useGraphQL in the package mentioned but im using this one: https://github.com/wesamco/ASP.Net-Core-GraphQL-Middleware

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment