ExpediaGroup / graphql-kotlin

Libraries for running GraphQL in Kotlin

Home Page:https://opensource.expediagroup.com/graphql-kotlin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scalar Upload is converted as String

rajeshomprakash opened this issue · comments

i want to test file upload, the graphql client converts the schema to kotlin data class files but i observe Scalar type Upload is mapped with String.

We write test scripts in kotlin to test mutations . How should be the request be constructed to test file upload
Screenshot 2023-08-12 at 5 44 37 PM
Screenshot 2023-08-12 at 5 45 03 PM

Upload is a custom scalar so by default it is typealiased to String, you can register custom converters to bind it to other types.


In general I'd advise against using a base64 "hack" to upload files through GraphQL. IMHO much better and scalable solution is to have a mutation that returns you presigned urls to a native solution (e.g. AWS, GCloud, etc).