简体   繁体   English

如果服务器是apollo graphql server,从android应用程序上传文件的最佳方法是什么?

[英]What is the best way to upload a file from android app if server is apollo graphql server

I should upload a file to server from Android app using Apollo framework. 我应该使用Apollo框架从Android应用程序上传文件到服务器。 The problem is that I couldn't find any library and any example for that. 问题是我找不到任何库和任何示例。 Is there any solution that you can provide? 你能提供什么解决方案吗? How to upload a file from mobile using Apollo framework? 如何使用Apollo框架从移动设备上传文件? Any idea? 任何想法?

If you are using apollo client for android to consume graphql queries and mutations you have to add customTypeMapping in your build.gradle file 如果您使用apollo client for android来使用graphql查询和突变,则必须在build.gradle文件中添加customTypeMapping

apollo {
  customTypeMapping = [
    "Upload" : "com.apollographql.apollo.api.FileUpload"
  ]
}

The Upload is a scalar recognized by graphql for uploading files to a server. 上传是graphql识别的标量,用于将文件上载到服务器。

Here is how to upload a file with a apollo client for android link 以下是如何使用apollo客户端上传文件以获取android 链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从移动设备(iOS或Android)将图像上传到服务器的最佳方法是什么 - What is best way to upload images from mobile (iOS or Android) to server 将文件上传到服务器的最佳方法是什么? - What is the best way to upload a file to server? 将数据从android应用程序传输到服务器上的数据库的最佳方法是什么? - what is the best way to transfer data from android app to a database on server? 阿波罗服务器 2 (graphql) 的图像上传功能 - image upload functionality with apollo server 2 (graphql) 使用 apollo kotlin 将图像上传到 Graphql 服务器 - Upload image to Graphql server using apollo kotlin 用户将数据从 Android 应用程序上传到 Web 服务器数据库的最佳方式 - Best Way For Users To Upload Data From Android App To Web Server Database 从Android应用程序将图像/视频上传到服务器的最佳方法是什么? - What is the best method to upload an image/videos to the server from android application? 什么是python服务器的最佳解决方案文件上传 - What is best solution file upload for python server 从移动应用中的服务器持续获取更新的最佳方法是什么? - What the best way to consistently get updates from Server in mobile app? 从Android手机上传图像到我的服务器的最简单方法是什么? - What is the simplest way to upload an image to my server from an Android phone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM