Skip to content

Urql exchange to support file uploads to an (Elixir) Absinthe backend

License

Notifications You must be signed in to change notification settings

9to5/urql-absinthe-upload-exchange

Repository files navigation

urql-absinthe-upload-exchange

Urql exchange to support file uploads to an (Elixir) Absinthe backend

Usage

Install the package:

npm install urql-absinthe-upload-exchange

Add the exchange to your urql client, right before the fetch exchange:

import { createClient, dedupExchange, cacheExchange, fetchExchange } from 'urql';
import absintheUploadExchange from 'urql-absinthe-upload-exchange';

const client = createClient({
  url: 'http://localhost:4000/graphql',
  exchanges: [dedupExchange, cacheExchange, absintheUploadExchange, fetchExchange],
});

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

This project is based on code originally provided by Harry Grumbar in this gist. Used with permission.