Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example with file upload / download endpoint API #129

Closed
avkonst opened this issue Aug 21, 2018 · 3 comments
Closed

Example with file upload / download endpoint API #129

avkonst opened this issue Aug 21, 2018 · 3 comments
Labels
Question ❔ Not future request, proposal or bug issue Solved ✔️ The issue has been solved

Comments

@avkonst
Copy link

avkonst commented Aug 21, 2018

First of all, I would like to say: nice job done! I have discovered your framework after exploring prisma and postgraphile. Yours is 10 times better!

Describe the issue
I have not found in the documentation how to implement client- to-server file upload API and server-to-client download API. I understand GraphQL allows this. How is it possible with TypeGraphQL. Example would be also good.

Are you able to make a PR that fix this?
Unlikely.

@avkonst avkonst changed the title Example with file upload / download mutation endpoint Example with file upload / download endpoint API Aug 21, 2018
@MichalLytek
Copy link
Owner

MichalLytek commented Aug 21, 2018

server-to-client download API. I understand GraphQL allows this.

No, GraphQL always returns objects (JSONs), so you can't stream video file or sth. You need to fallback to good old HTTP and maybe REST API with express.js for things like images or files download (or use base64 😆).

For uploading files, there is an issue for this:
#37

@MichalLytek MichalLytek added the Question ❔ Not future request, proposal or bug issue label Aug 21, 2018
@MichalLytek
Copy link
Owner

Closing as the example and docs for apollo-upload will be done along with the integration itself.

@MichalLytek MichalLytek added the Solved ✔️ The issue has been solved label Oct 22, 2018
@ozyman42
Copy link

ozyman42 commented Nov 8, 2019

Here is a definitely terrible idea: you could base64 encode the file, and split it up into chunks, then send the chunks as a GraphQL paginated response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question ❔ Not future request, proposal or bug issue Solved ✔️ The issue has been solved
Projects
None yet
Development

No branches or pull requests

3 participants