@r26d/absinthe-apollo-upload-link v1.1.0
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
createUploadLink
Creates a terminating Apollo Link
capable of file uploads. Options match createHttpLink.
Parameters
optionsobject Options.options.uristring GraphQL endpoint URI. (optional, default/graphql)options.fetchFunction?fetchimplementation to use, defaulting to thefetchglobal.options.fetchOptionsFetchOptions?fetchoptions; overridden by upload requirements.options.credentialsstring? Overridesoptions.fetchOptions.credentials.options.headersobject? Merges with and overridesoptions.fetchOptions.headers.options.includeExtensionsboolean Toggles sendingextensionsfields to the GraphQL server. (optional, defaultfalse)
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
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago