Updated packages (#1133)

* Upgrading nugets

* doc changes

* more changes to remove warnings

* one more fix

* one more fix

* forcing the build
This commit is contained in:
Pedram Rezaei
2020-04-11 02:00:58 -07:00
committed by GitHub
parent 4110837a04
commit 84821c6c8d
32 changed files with 125 additions and 132 deletions

View File

@ -11,7 +11,7 @@
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ocelot" Version="5.5.1" />
<PackageReference Include="GraphQL" Version="2.0.0-alpha-870" />
<PackageReference Include="Ocelot" Version="14.0.9" />
<PackageReference Include="GraphQL" Version="2.4.0" />
</ItemGroup>
</Project>

View File

@ -28,7 +28,7 @@ namespace OcelotGraphQL
public class Query
{
private List<Hero> _heroes = new List<Hero>
private readonly List<Hero> _heroes = new List<Hero>
{
new Hero { Id = 1, Name = "R2-D2" },
new Hero { Id = 2, Name = "Batman" },
@ -58,7 +58,7 @@ namespace OcelotGraphQL
var query = await request.Content.ReadAsStringAsync();
//if not body try query string, dont hack like this in real world..
if(query.Length == 0)
if (query.Length == 0)
{
var decoded = WebUtility.UrlDecode(request.RequestUri.Query);
query = decoded.Replace("?query=", "");
@ -82,7 +82,7 @@ namespace OcelotGraphQL
public class Program
{
public static void Main(string[] args)
public static void Main()
{
var schema = Schema.For(@"
type Hero {
@ -93,7 +93,8 @@ namespace OcelotGraphQL
type Query {
hero(id: Int): Hero
}
", _ => {
", _ =>
{
_.Types.Include<Query>();
});
@ -109,10 +110,11 @@ namespace OcelotGraphQL
.AddJsonFile("ocelot.json", false, false)
.AddEnvironmentVariables();
})
.ConfigureServices(s => {
s.AddSingleton<ISchema>(schema);
s.AddOcelot()
.AddSingletonDelegatingHandler<GraphQlDelegatingHandler>();
.ConfigureServices(s =>
{
s.AddSingleton<ISchema>(schema);
s.AddOcelot()
.AddDelegatingHandler<GraphQlDelegatingHandler>();
})
.ConfigureLogging((hostingContext, logging) =>
{
@ -125,7 +127,7 @@ namespace OcelotGraphQL
app.UseOcelot().Wait();
})
.Build()
.Run();
}
.Run();
}
}
}