Search code examples
.nethotchocolate

File Upload in Hot chocolate


I've been searching for a way to upload a file (eg. images) using Hot Chocolate and I don't seem to find anything about it in their Docs.

Does anyone know how to do it?

Thanks in advance


Solution

  • From the Hotchocolate slack channel here is the answer to that question:

    unofficially there is this https://gist.github.com/PascalSenn/9b623a439426fa361552632d8bd7972a

    and also you can use this:

    if they're small files, you can use base64-encoded strings, but that obviously has some limitations

    Those are the answers that from my opinion fit best to your question.

    Here is the link to the conversation in slack: https://hotchocolategraphql.slack.com/archives/CD9TNKT8T/p1597299757043300

    NOTE: you have to subscribe first to see the thread