Last active
June 9, 2017 17:59
-
-
Save koistya/aff5ef003d5e137a165c26bba2b224f7 to your computer and use it in GitHub Desktop.
GraphQL with .NET Core, C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Example | |
{ | |
public class RootQueryType | |
{ | |
public Func<string> Hello { get; set; } = () => "world"; | |
} | |
public class Schema | |
{ | |
public RootQueryType Query { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Could you share where you found the UseGraphQL extension method?
This is implementantion of that https://github.com/graphql-dotnet/graphql-dotnet ?
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
Example Query
GraphQL Schema
http://graphql.org/