This commit is contained in:
2026-05-15 02:51:02 +03:30
parent 2a88195d15
commit d47f57a620
17 changed files with 1268 additions and 64 deletions
+13 -12
View File
@@ -2,6 +2,7 @@ using System;
using GraphQL;
using GraphQL.Server;
using GraphQL.Server.Ui.Playground;
using GraphQL.Server.Ui.Voyager;
using GraphQL.Types;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
@@ -12,14 +13,10 @@ using MySql.EntityFrameworkCore.Extensions;
using xCommons.Extensions;
using xDataService.Constants;
using xDataService.Db;
using xDataService.EFRepositories;
using xDataService.Events;
using xDataService.Extensions;
using xDataService.GraphQL;
using xDataService.InMemRepositories;
using xDataService.Interfaces;
using xDataService.Models;
using xDataService.MongoRepositories;
using xDataService.Providers;
using xExceptions.Constants;
using xModels.Base;
@@ -1197,6 +1194,7 @@ namespace xDataService.Helpers
/// <typeparam name="TGraphTypeHelperImplementation"></typeparam>
/// <typeparam name="TGraphSchema"></typeparam>
/// <param name="source"></param>
/// <param name="graphBasePath"></param>
/// <param name="graphPath"></param>
/// <param name="withPlayGround"></param>
/// <param name="options"></param>
@@ -1211,9 +1209,9 @@ namespace xDataService.Helpers
TGraphSchema
>(
IApplicationBuilder source,
string graphBasePath,
string graphPath,
bool withPlayGround = false,
GraphQLPlaygroundOptions options = null
bool withPlayGround = false
)
where TGraphSchema : Schema
where TGraphKey : IGraphType
@@ -1231,15 +1229,18 @@ namespace xDataService.Helpers
if (withPlayGround)
{
//
if (options.IsNull())
source.UseGraphQLPlayground(new GraphQLPlaygroundOptions
{
options = new GraphQLPlaygroundOptions();
}
options.Path = "/ui/playground";
options.GraphQLEndPoint = graphPath;
Path = "/ui/playground",
GraphQLEndPoint = graphBasePath
});
//
source.UseGraphQLPlayground(options);
source.UseGraphQLVoyager(new GraphQLVoyagerOptions
{
Path = "/ui/voyager",
GraphQLEndPoint = graphBasePath
});
}
}
#endregion