There's a great blog post by Apollo on Apollo file uploads here, essentially they recommend using a 3rd party image service or pre-signed upload urls (e.g. fetch a pre-signed url via graphql, upload the image directly to that url, then save the location / id of the image through a graphql mutation).
There is a standard for uploading images through a graphql request, although Apollo don't recommend it, but the most popular Node.js package to help with this is graphql-upload.
To get this working with Apollo 4 and Express (if this is what you're using), you'll need to follow their instructions for using express middleware here.
Note that Apollo will block "simple" CORS requests to prevent CSRF attacks, which is likely to affect your image upload, so you need to follow the instructions here to include additional headers in your request or disable CSRF protection (not recommended). You can see an example of this by excluding the Apollo-Require-Preflight
header from the CURL request below.
Here's a minimal example of graphql upload in codesandbox.
And a CURL request to test it
$ curl https://2nnbw4-4000.csb.app/ \
-F operations='{ "query": "mutation ($id: String!, $image: Upload!) { uploadImage(id: $id, image: $image) { id filename } }", "variables": { "image": null, "id": "1" } }' \
-F map='{ "0": ["variables.image"] }' \
-F 0=@tmp.jpg \
-H 'Apollo-Require-Preflight: true'
{"data":{"uploadImage":{"id":"1","filename":"tmp.jpg"}}}