I am using graphQL for my APIs and now I need to receive a file in the request as a multipart file, so how to send that file using Postman to my controller?
@Data
public class FileDTO {
private MultipartFile smsFile;
}
@Controller
public class SMSBulkController {
@Autowired
ParsingService parsingService;
@MutationMapping
public ApiResponse<String> uploadFile(@Argument FileDTO file) throws IOException {
parsingService.upload(file);
return ApiResponse.success("success");
}
}
and this is my graphql file:
scalar Upload
input smsFileInput{
smsFile: Upload
}
type Mutation{upload(file: smsFileInput):MutateApiResponse}