Skip to content

Commit 11c7eb3

Browse files
committed
Add changeset
1 parent b8eac26 commit 11c7eb3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.changesets/11175.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- feat(uploads): Configure apollo client to do multi-part form uploads (#11175) by @dac09
2+
3+
a) Configures the Apollo client we export to use upload link - https://github.com/jaydenseric/apollo-upload-client
4+
b) Configures our API side fastify server to accept multipart form data
5+
6+
7+
Notes:
8+
1. apollo-upload-client is ESM only. In order to get this working for prerender, I had to bundle it for CJS version only.
9+
Without this change you get errors during prerender like this:
10+
```
11+
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/dac09/Experiments/apollo-upload-link/node_modules/apollo-upload-client/createUploadLink.mjs not supported.
12+
```
13+
14+
2. Currently the multi-part config only applies when you have a server file (see separate PR with fix: https://github.com/redwoodjs/redwood/pull/11176)
15+
16+
3. The upload link internally will handle whether to do a regular POST or multipart POST. In order to make use of this on the backend you need to set your graphql schema field to a scalar of `File`

0 commit comments

Comments
 (0)