提问人:Amarildo 提问时间:7/21/2023 最后编辑:Amarildo 更新时间:7/22/2023 访问量:23
我正在尝试将上传与graphQL一起使用,但我得到ServerParseError
Iam trying to use the upload with graphQL but i get ServerParseError
问:
这就是我尝试在香蕉蛋糕中运行突变时得到的这是我的请求类以及我如何处理它
public class TestClass
{
[GraphQLName("Test")]
public class Request : IRequest<AuditableEntity>
{
public string? Path { get; set; }
[GraphQLType(typeof(NonNullType<UploadType>))]
public IFile File { get; set; }
public Guid? UserId { get; set; }
}
public class TestClassCommandHandler : IRequestHandler<Request, AuditableEntity>
{
private BlobServiceClient _blobServiceClient;
public TestClassCommandHandler(BlobServiceClient blobServiceClient)
{
_blobServiceClient = blobServiceClient;
}
public async Task<AuditableEntity> Handle(Request request, CancellationToken cancellationToken)
{
//var isdeleted = await AppHelper.DeletePhoto(_blobServiceClient, request.Path);
var uploaddd = await AppHelper.UploadProfile(_blobServiceClient, request.File, request.UserId.ToString());
User user = new User();
return user;
}
}
}
这就是我在程序 .cs 中配置 GraphQL 的方式
builder.Services.AddGraphQLServer()
.AddType<UploadType>()
.AddType<ListType<UploadType>>()
.InitializeOnStartup()
.AddMutationType<Mutation>()
.AddQueryType<Query>()
当我尝试从香蕉蛋糕运行此突变时,它会抛出 ServerParseError
答: 暂无答案
评论