npm package: @r26d/absinthe-apollo-upload-link
Description: A terminating Apollo Link for Apollo Client that allows FileList, File, Blob or ReactNativeFile instances within query or mutation variables and sends GraphQL multipart requests. Modified to support the Absinthe way of posting files
Latest version: 1.1.0

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [@r26d/absinthe-apollo-upload-link](#r26dabsinthe-apollo-upload-link)
  - [API](#api)
    - [FetchOptions](#fetchoptions)
      - [Properties](#properties)
    - [createUploadLink](#createuploadlink)
      - [Parameters](#parameters)
      - [Examples](#examples)
  - [API](#api-1)
  - [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# @r26d/absinthe-apollo-upload-link

> A terminating Apollo Link for Apollo Client that allows FileList, File, Blob or ReactNativeFile instances within query or mutation variables and sends GraphQL multipart requests. Modified to support the Absinthe way of posting files

**This fork modifies the request format to support Absinthe's way of handling file uploads.**

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### FetchOptions

*   **See**: [Polyfillable fetch options](https://github.github.io/fetch#options).

GraphQL request `fetch` options.

Type: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

#### Properties

*   `headers` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** HTTP request headers.
*   `credentials` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Authentication credentials mode.

### createUploadLink

*   **See**: [GraphQL multipart request spec](https://github.com/jaydenseric/graphql-multipart-request-spec).
*   **See**: [apollo-link on GitHub](https://github.com/apollographql/apollo-link).

Creates a terminating [Apollo Link](https://apollographql.com/docs/link)
capable of file uploads. Options match [`createHttpLink`](https://apollographql.com/docs/link/links/http#options).

#### Parameters

*   `options` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options.

    *   `options.uri` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** GraphQL endpoint URI. (optional, default `/graphql`)
    *   `options.fetch` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** [`fetch`](https://fetch.spec.whatwg.org) implementation to use, defaulting to the `fetch` global.
    *   `options.fetchOptions` **[FetchOptions](#fetchoptions)?** `fetch` options; overridden by upload requirements.
    *   `options.credentials` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Overrides `options.fetchOptions.credentials`.
    *   `options.headers` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Merges with and overrides `options.fetchOptions.headers`.
    *   `options.includeExtensions` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Toggles sending `extensions` fields to the GraphQL server. (optional, default `false`)

#### Examples

A basic Apollo Client setup.

````javascript
```js
const { ApolloClient } = require('apollo-client')
const { InMemoryCache } = require('apollo-cache-inmemory')
const { createUploadLink } = require('apollo-upload-client')

const client = new ApolloClient({
  cache: new InMemoryCache(),
  link: createUploadLink()
})
```
````

Returns **ApolloLink** A terminating [Apollo Link](https://apollographql.com/docs/link) capable of file uploads.

## API

## License

[MIT](LICENSE.txt) :copyright:  r26D LLC