basic query and mutation discovery, next dynamic queries get added through extensions :)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentValidation.AspNetCore" Version="9.5.0" />
|
||||
<PackageReference Include="HotChocolate.AspNetCore" Version="11.0.9" />
|
||||
<PackageReference Include="PoweredSoft.Data" Version="2.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.6.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.6.3" />
|
||||
@@ -17,6 +18,7 @@
|
||||
<ProjectReference Include="..\PoweredSoft.CQRS.DynamicQuery.Abstractions\PoweredSoft.CQRS.DynamicQuery.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\PoweredSoft.CQRS.DynamicQuery.AspNetCore\PoweredSoft.CQRS.DynamicQuery.AspNetCore.csproj" />
|
||||
<ProjectReference Include="..\PoweredSoft.CQRS.DynamicQuery\PoweredSoft.CQRS.DynamicQuery.csproj" />
|
||||
<ProjectReference Include="..\PoweredSoft.CQRS.GraphQL.HotChocolate\PoweredSoft.CQRS.GraphQL.HotChocolate.csproj" />
|
||||
<ProjectReference Include="..\PoweredSoft.CQRS\PoweredSoft.CQRS.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
+18
-7
@@ -4,6 +4,7 @@ using Demo.DynamicQueries;
|
||||
using Demo.Queries;
|
||||
using FluentValidation;
|
||||
using FluentValidation.AspNetCore;
|
||||
using HotChocolate.Types;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
@@ -18,6 +19,7 @@ using PoweredSoft.CQRS.AspNetCore.Mvc;
|
||||
using PoweredSoft.CQRS.DynamicQuery;
|
||||
using PoweredSoft.CQRS.DynamicQuery.Abstractions;
|
||||
using PoweredSoft.CQRS.DynamicQuery.AspNetCore;
|
||||
using PoweredSoft.CQRS.GraphQL.HotChocolate;
|
||||
using PoweredSoft.Data;
|
||||
using PoweredSoft.Data.Core;
|
||||
using PoweredSoft.DynamicQuery;
|
||||
@@ -27,7 +29,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Demo
|
||||
{
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
@@ -56,7 +58,15 @@ namespace Demo
|
||||
.AddPoweredSoftDynamicQueries()
|
||||
.AddFluentValidation();
|
||||
|
||||
services.AddSwaggerGen();
|
||||
services
|
||||
.AddGraphQLServer()
|
||||
.AddQueryType(d => d.Name("Query"))
|
||||
.AddPoweredSoftQueries()
|
||||
.AddMutationType(d => d.Name("Mutation"))
|
||||
.AddPoweredSoftMutations();
|
||||
|
||||
|
||||
//services.AddSwaggerGen();
|
||||
}
|
||||
|
||||
private void AddDynamicQueries(IServiceCollection services)
|
||||
@@ -100,18 +110,19 @@ namespace Demo
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseSwagger();
|
||||
//app.UseSwagger();
|
||||
|
||||
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
|
||||
// specifying the Swagger JSON endpoint.
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
|
||||
});
|
||||
//app.UseSwaggerUI(c =>
|
||||
//{
|
||||
// c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
|
||||
//});
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
endpoints.MapGraphQL();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user