🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@urql/exchange-multipart-fetch

Package Overview
Dependencies
Maintainers
25
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@urql/exchange-multipart-fetch

An exchange that allows regular fetch and will transition to multipart when files are included

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
3.7K
-22.86%
Maintainers
25
Weekly downloads
 
Created
Source

@urql/exchange-multipart-fetch

DEPRECATION NOTICE: The multipartFetchExchange has been deprecated, and @urql/core now supports GraphQL Multipart Requests natively. This won't break the behaviour of your existing apps, however, it's recommended to remove the multipartFetchExchange from your apps.

The multipartFetchExchange is an exchange that builds on the regular fetchExchange but adds the multipart file upload capability.

Quick Start Guide

First install @urql/exchange-multipart-fetch alongside urql:

yarn add @urql/exchange-multipart-fetch
# or
npm install --save @urql/exchange-multipart-fetch

You'll then need to add the multipartFetchExchange method, that this package exposes, to your exchanges.

import { createClient, dedupExchange, cacheExchange } from 'urql';
import { multipartFetchExchange } from '@urql/exchange-multipart-fetch';

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

Now we can start uploading files to our server!

Keywords

urql

FAQs

Package last updated on 31 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts