apollo
apollo copied to clipboard
feat: support apollo-upload-client
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.
Deploy Preview for apollo-module canceled.
Name | Link |
---|---|
Latest commit | c16100675d89008ac9e3c503b0e7d599ec3f3a33 |
Latest deploy log | https://app.netlify.com/sites/apollo-module/deploys/636cbb8d92af74000915ae8c |
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: https://github.com/jaydenseric/apollo-upload-client/issues/280
thank you @art-boer! Im slowly moving to nuxt3 and wanted to implement the same. I hope this PR will be merged soon
@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.
Deploy Preview for apollo-module canceled.
Name | Link |
---|---|
Latest commit | 91cd01b3bb44200175b43c830bdb8b5c4555cac8 |
Latest deploy log | https://app.netlify.com/sites/apollo-module/deploys/63972389941f0d00080427d3 |
@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!
@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
any updates here guys
is there a reason this has not been reviewed yet or is there another implementation?
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.
any updates?
any updates?