This commit is contained in:
2026-06-01 01:04:55 +03:30
parent 5d3b7d9819
commit e101ec342e
37 changed files with 917 additions and 27 deletions
@@ -0,0 +1,25 @@
using xCategoryService.Interfaces.Entities;
using xCategoryService.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xCategoryService.Providers.GraphQL
{
public class XCategoryGraphQLTypeHelper : XBaseGraphQLTypeHelper<XCategory, int>, IXCategoryGraphQLTypeHelper
{
public XCategoryGraphQLTypeHelper(
XDataServiceConfiguration configuration
) : base(configuration)
{ }
public override string GetInQueryCollectionName()
{
return "categories";
}
public override string GetInQuerySingleName()
{
return "category";
}
}
}
+22
View File
@@ -0,0 +1,22 @@
using GraphQL.Types;
using xCategoryService.Interfaces.Entities;
using xCategoryService.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
namespace xCategoryService.Providers.GraphQL
{
public class XCategoryGraphQuery : XBaseGraphQLQuery<XCategory, int, XCategoryGraphType, IntGraphType>
{
public XCategoryGraphQuery(
XDataServiceConfiguration configuration,
IXCategoryRepository repository,
IXCategoryGraphQLTypeHelper helper
) : base(
configuration,
repository,
helper
)
{ }
}
}
+13
View File
@@ -0,0 +1,13 @@
using System;
using GraphQL.Types;
namespace xCategoryService.Providers.GraphQL
{
public class XCategoryGraphSchema : Schema
{
public XCategoryGraphSchema(IServiceProvider services) : base(services)
{
Query = (XCategoryGraphQuery)services.GetService(typeof(XCategoryGraphQuery));
}
}
}
+15
View File
@@ -0,0 +1,15 @@
using xCategoryService.Models.Entities;
using xDataService.GraphQL;
namespace xCategoryService.Providers.GraphQL
{
public class XCategoryGraphType : XBaseGraphObjectType<XCategory, int>
{
public XCategoryGraphType() : base()
{
Field(x => x.Title);
Field(x => x.Description);
Field(x => x.References);
}
}
}
@@ -3,6 +3,7 @@ using xCategoryService.Interfaces.Entities;
using xCategoryService.Models.Entities;
using xDataService.Configuration;
using xDataService.GraphQL;
using xDataService.Interfaces;
namespace xCategoryService.Providers.GraphQL
{