Iam trying to use the upload with graphQL but i get ServerParseError

28 views Asked by At

This is what i get when i try to run the mutation in bananacakeThis is my request class and how i handle it

 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;
            }
        }
    }

This is how i have configured the GraphQL in program.cs

builder.Services.AddGraphQLServer()
    .AddType<UploadType>()
    .AddType<ListType<UploadType>>()
    .InitializeOnStartup()
    .AddMutationType<Mutation>()
    .AddQueryType<Query>()

And when i try to run this mutation from bananacake it throws an ServerParseError

0

There are 0 answers