adding Data Requirement on XContent Service ...
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using xContentService.Constants;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphQLTypeHelper : XBaseGraphQLTypeHelper<XContent, Guid>, IXContentGraphQLTypeHelper
|
||||
{
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return XContentServiceConstants.XContentCollectionName;
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return XContentServiceConstants.XContentSingleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xContentService.Interfaces.Entities;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphQuery : XBaseGraphQLQuery<XContent, Guid, XContentGraphType, GuidGraphType>
|
||||
{
|
||||
public XContentGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXContentRepository repository,
|
||||
IXContentGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphSchema : Schema
|
||||
{
|
||||
public XContentGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XContentGraphQuery)services.GetService(typeof(XContentGraphQuery));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using xContentService.Models.Entities;
|
||||
using xDataService.GraphQL;
|
||||
|
||||
namespace xContentService.Providers.GraphQL
|
||||
{
|
||||
public class XContentGraphType : XBaseGraphObjectType<XContent, Guid>
|
||||
{
|
||||
public XContentGraphType() : base()
|
||||
{
|
||||
Field(x => x.Title);
|
||||
Field(x => x.OwnerId);
|
||||
Field(x => x.CreatedOn);
|
||||
Field(x => x.UpdatedAt);
|
||||
Field(x => x.Description);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user