Absinthe Relay image upload with Expo React Native

Hello comrades,

I made a small project that has an Elixir Phoenix Absinthe Relay backend and an Expo React Native frontend.

Here’s the code: GitHub - peaceful-james/absimupo: Absinthe Elixir Phoenix image upload with Expo React Native

All it does is let you upload images of “things” but it has some nice stuff:

  1. subscriptions - new “things” with “logos” will appear to other people.
  2. paginating - preserved with new data from the subscription
  3. mostly websocket - I hacked a custom relay environment that checks if there are uploadables. If there are uploadables, it does a normal HTTP multipart form request. If not, it just uses the websocket.

This project is just meant to act as a reference for myself and other people using Absinthe Relay and Expo. It’s not pretty, it has no security and it’s pretty much useless IRL.

I’m putting it on this forum for posterity. Maybe it will help somebody trying to get image uploading working with Absinthe Relay connections.

I deployed it! https://absimupo.peacefulprogramming.dev/
Anyone is free to upload any image for a while! :worried: Please don’t abuse it.

3 Likes