You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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