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

feat: support apollo-upload-client #447

Open
wants to merge 5 commits into
base: v5
Choose a base branch
from

Conversation

art-boer
Copy link

@art-boer art-boer commented Nov 9, 2022

Support for apollo-upload-client

Sometimes you want your client to be able to communicate with a GraphQL server that has uploads enabled, however, you would also need a HttpLink that supports the uploading of files.

In this MR I have created a conditional option (per client) for using the Upload HttpLink instead of the default Apollo HttpLink.

@netlify
Copy link

netlify bot commented Nov 9, 2022

Deploy Preview for apollo-module canceled.

Name Link
🔨 Latest commit c161006
🔍 Latest deploy log https://app.netlify.com/sites/apollo-module/deploys/636cbb8d92af74000915ae8c

@art-boer
Copy link
Author

Since Vite/Rollup does not always support CJS to ESM I have used the @originjs/vite-plugin-commonjs plugin to be able to use apollo-upload-client. Webpack does not seem to have this issue.

See: jaydenseric/apollo-upload-client#280

@art-boer art-boer marked this pull request as ready for review November 10, 2022 08:55
@Diizzayy Diizzayy self-assigned this Nov 10, 2022
@LorDeCry
Copy link

LorDeCry commented Dec 8, 2022

thank you @art-boer! Im slowly moving to nuxt3 and wanted to implement the same.
I hope this PR will be merged soon

@art-boer
Copy link
Author

art-boer commented Dec 8, 2022

@Diizzayy Any chance to have a look at it yet? If you need me to look at an alternative implementation or solution for the ESM import then let me know! I would love to help out.

@netlify
Copy link

netlify bot commented Dec 12, 2022

Deploy Preview for apollo-module canceled.

Name Link
🔨 Latest commit 91cd01b
🔍 Latest deploy log https://app.netlify.com/sites/apollo-module/deploys/63972389941f0d00080427d3

@art-boer
Copy link
Author

@Diizzayy I have found a better way to fix the import of apollo-upload-client, without using yet another Vite plugin. A simple alias for 'apollo-upload-client' pointing towards the index.mjs file does the trick!

@thanhhauqn07
Copy link

thanhhauqn07 commented Dec 16, 2022

@Diizzayy I have found a better way to fix the import of apollo-upload-client, without using yet another Vite plugin. A simple alias for 'apollo-upload-client' pointing towards the index.mjs file does the trick!

I tried it and it works. Tks @art-boer
I hope this PR will be merged soon

@proalaa
Copy link

proalaa commented Apr 16, 2023

any updates here guys

@ybtam
Copy link

ybtam commented Aug 29, 2023

is there a reason this has not been reviewed yet or is there another implementation?

@LeoAdamek
Copy link

Is there a reason this PR hasn't been merged? Not being able to handle file uploads is a blocker for many projects, which creates a trap for those upgrading from Nuxt 2. Nuxt 2 Apollo doesn't work on supported Node versions, and Nuxt 3 Apollo is missing this critical feature. There's no obvious workaround for this without support in the module.

@datge
Copy link

datge commented Apr 30, 2024

any updates?

1 similar comment
@Luferov
Copy link

Luferov commented Aug 9, 2024

any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants