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

file upload with Upload type #56

Closed
sagswe opened this issue Jan 21, 2020 · 1 comment
Closed

file upload with Upload type #56

sagswe opened this issue Jan 21, 2020 · 1 comment
Assignees

Comments

@sagswe
Copy link

sagswe commented Jan 21, 2020

Can we use file upload facility with apollo-server 2. Currently its giving error
Unexpected token - in JSON at position 0
at JSON.parse ()
at createStrictSyntaxError (apollon-template/node_modules/body-parser/lib/types/json.js:158:10)

@VincentMarrec
Copy link
Collaborator

Hello,

Apollon was not designed to use file upload by default, since all the APIs do not require so.

Therefore, you can use the package "graphql-upload" that will do the trick.

There is an example of how to implement a file upload here : https://github.com/VincentMarrec/apollon-demos/tree/file-upload

Let me know if it helped you !

@lymeo lymeo closed this as completed Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants