I am not sure how I can explain my issue clearly here.
I have a graphql mutation inside of flutter which calls an .Net Api to upload a multipart file to Azure blob storage. Here is the bare bones .net api method -
public async Task<Result> UploadFiles(string containerName, List<IFile> files)
{
Console.WriteLine("test");
return new Result
{
Status = 200,
};
}
The above method will be called from the flutter application like below -
final _fileUploadMutation = """
mutation(\$containerName: String, \$files: [Upload]) {
uploadFiles(containerName: \$containerName, files: \$files) {
status
}
}
""";
Future<bool> fileUploadMutation(User user) async {
user.id = '+1416899991';
print(user.toString());
String containerName = user.id.substring(
1);
QueryResult result = await _client().mutate(
MutationOptions(document: gql(_fileUploadMutation), variables: {
"containerName": containerName,
"files": user.files
} // this
),
);
print(result);
if (result.hasException) {
print(result.exception?.graphqlErrors[0].message);
} else if (result.data != null) {
//user.avatarUrl = result.data!['UploadFiles'][0];
user.avatarUrl = 'www.bol.com';
return true;
}
return false;
}
When the code runs I get a HttpLinkParserException error thrown which says FormatException: Unexpected end of input (at character 1)