last ...
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user