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 not supported (and API doesn't allow to modify links structure) #553

Open
thibautvs opened this issue Sep 28, 2023 Discussed in #552 · 3 comments
Open

File upload not supported (and API doesn't allow to modify links structure) #553

thibautvs opened this issue Sep 28, 2023 Discussed in #552 · 3 comments

Comments

@thibautvs
Copy link

Discussed in #552

Originally posted by thibautvs September 27, 2023
[UPDATE]

So I basically had to completely rebuild and override the apollo client as the current API basically only allows to pass options, but not redefine the link structure, which was needed to configure apollo-upload-link.

As the file upload feature is pretty common in web apps, it would be best to support it by default in the library, or at least allow an easy configuration via the exposed API.


Hello,

I'm trying to do a file upload using GraphQL but it's not working (Could not get uploaded file, be sure to conform to GraphQL multipart request specification). The file upload is defined in the GraphQL schema using a Upload type I'm trying to configure apollo-upload-client but can't find any example on how to do that in Nuxt 3. I've also come across a few comments saying that it's already built-in in the @nuxtjs/apollo library. What is the situation and what approach should I take?

Thanks in advance!

@travisricks
Copy link

@thibautvs can you please provide more guidance on how you solved this? I'm having the same problem.

@bmulholland
Copy link

@travisricks #447 has much of it.

If you use SSR, it's probably easiest to just configure Apollo yourself. That's what I ended up doing. There were a few tricks I had to pull from this module, such as optimizeDeps changes, and I referred to the module source for that. It's not super trivial, but also not that hard, and certainly better than being completely blocked.

@travisricks
Copy link

@bmulholland thanks for the link.

I ended up solving this the same way, but by adding a patch in my project for the package that uses createUploadLink instead of createHttpLink.

Hopefully that PR can be merged though.

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