1.1.0 • Published 1 year ago

@r26d/absinthe-apollo-upload-link v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

Table of Contents generated with DocToc

@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

FetchOptions

GraphQL request fetch options.

Type: object

Properties

  • headers object HTTP request headers.
  • credentials string? Authentication credentials mode.

createUploadLink

Creates a terminating Apollo Link capable of file uploads. Options match createHttpLink.

Parameters

  • options object Options.

    • options.uri string GraphQL endpoint URI. (optional, default /graphql)
    • options.fetch Function? fetch implementation to use, defaulting to the fetch global.
    • options.fetchOptions FetchOptions? fetch options; overridden by upload requirements.
    • options.credentials string? Overrides options.fetchOptions.credentials.
    • options.headers object? Merges with and overrides options.fetchOptions.headers.
    • options.includeExtensions boolean Toggles sending extensions fields to the GraphQL server. (optional, default false)

Examples

A basic Apollo Client setup.

```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 capable of file uploads.

API

License

MIT :copyright: r26D LLC

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.3.0

1 year ago

0.3.6

1 year ago

0.3.7

1 year ago

0.3.1

1 year ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.3

2 years ago

0.1.0

4 years ago

0.0.13

4 years ago

0.0.10

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago