From e4e07a48fde111d21af490bdb90785d59d508c7f Mon Sep 17 00:00:00 2001 From: "dan.narsavage" Date: Mon, 4 Dec 2017 11:14:45 -0700 Subject: [PATCH 1/2] Added GraphiQL NuGet package. Uncommented Database.Migrate() to create database in new environments. Fixed a typo. --- StarWars.Api/Controllers/GraphQLController.cs | 2 +- StarWars.Api/StarWars.Api.csproj | 1 + StarWars.Api/Startup.cs | 1 + StarWars.Data/EntityFramework/StarWarsContext.cs | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/StarWars.Api/Controllers/GraphQLController.cs b/StarWars.Api/Controllers/GraphQLController.cs index 85558bd..cd692a5 100644 --- a/StarWars.Api/Controllers/GraphQLController.cs +++ b/StarWars.Api/Controllers/GraphQLController.cs @@ -52,7 +52,7 @@ public async Task Post([FromBody] GraphQLQuery query) } catch (Exception ex) { - _logger.LogError("Document exexuter exception", ex); + _logger.LogError("Document executer exception", ex); return BadRequest(ex); } } diff --git a/StarWars.Api/StarWars.Api.csproj b/StarWars.Api/StarWars.Api.csproj index 883a6f6..aa14d56 100644 --- a/StarWars.Api/StarWars.Api.csproj +++ b/StarWars.Api/StarWars.Api.csproj @@ -26,6 +26,7 @@ + diff --git a/StarWars.Api/Startup.cs b/StarWars.Api/Startup.cs index d7832bf..5bee36b 100644 --- a/StarWars.Api/Startup.cs +++ b/StarWars.Api/Startup.cs @@ -71,6 +71,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); + app.UseGraphiQl(); app.UseStaticFiles(); app.UseMvc(); diff --git a/StarWars.Data/EntityFramework/StarWarsContext.cs b/StarWars.Data/EntityFramework/StarWarsContext.cs index 0ff5e46..af83c92 100644 --- a/StarWars.Data/EntityFramework/StarWarsContext.cs +++ b/StarWars.Data/EntityFramework/StarWarsContext.cs @@ -18,7 +18,7 @@ public StarWarsContext(DbContextOptions options, ILogger logger { _logger = logger; //Database.EnsureCreated(); - //Database.Migrate(); + Database.Migrate(); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) From 0a4a2c6cc1e70f332ac0e8d7f2e6a6e35d0d3be3 Mon Sep 17 00:00:00 2001 From: "dan.narsavage" Date: Mon, 4 Dec 2017 14:52:35 -0700 Subject: [PATCH 2/2] Added comment to test things --- StarWars.Api/Controllers/GraphQLController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/StarWars.Api/Controllers/GraphQLController.cs b/StarWars.Api/Controllers/GraphQLController.cs index cd692a5..8f742ed 100644 --- a/StarWars.Api/Controllers/GraphQLController.cs +++ b/StarWars.Api/Controllers/GraphQLController.cs @@ -39,6 +39,7 @@ public async Task Post([FromBody] GraphQLQuery query) try { + // Test var result = await _documentExecuter.ExecuteAsync(executionOptions).ConfigureAwait(false); if (result.Errors?.Count > 0)