last ...
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphQLTypeHelper : XBaseGraphQLTypeHelper<XFile, Guid>, IXFileGraphQLTypeHelper
|
||||
{
|
||||
public XFileGraphQLTypeHelper(
|
||||
XDataServiceConfiguration configuration
|
||||
) : base(configuration)
|
||||
{ }
|
||||
|
||||
public override string GetInQueryCollectionName()
|
||||
{
|
||||
return "files";
|
||||
}
|
||||
|
||||
public override string GetInQuerySingleName()
|
||||
{
|
||||
return "file";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
using xDataService.Configuration;
|
||||
using xDataService.GraphQL;
|
||||
using xFileService.Interfaces.Entities;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphQuery : XBaseGraphQLQuery<XFile, Guid, XFileGraphType, GuidGraphType>
|
||||
{
|
||||
public XFileGraphQuery(
|
||||
XDataServiceConfiguration configuration,
|
||||
IXFileRepository repository,
|
||||
IXFileGraphQLTypeHelper helper
|
||||
) : base(
|
||||
configuration,
|
||||
repository,
|
||||
helper
|
||||
)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using GraphQL.Types;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphSchema : Schema
|
||||
{
|
||||
public XFileGraphSchema(IServiceProvider services) : base(services)
|
||||
{
|
||||
Query = (XFileGraphQuery)services.GetService(typeof(XFileGraphQuery));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using xDataService.GraphQL;
|
||||
using xFileService.Models.Entities;
|
||||
|
||||
namespace xFileService.Providers.GraphQL
|
||||
{
|
||||
public class XFileGraphType : XBaseGraphObjectType<XFile, Guid>
|
||||
{
|
||||
public XFileGraphType() : base()
|
||||
{
|
||||
Field(x => x.Type);
|
||||
Field(x => x.Name);
|
||||
Field(x => x.Path);
|
||||
Field(x => x.Thumb);
|
||||
Field(x => x.OwnerId);
|
||||
Field(x => x.FileName);
|
||||
Field(x => x.ThumbPath);
|
||||
Field(x => x.UploadedOn);
|
||||
Field(x => x.References);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user