From 261bb38c573a2fdf9175ee39b088e9a912305097 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 31 Jan 2018 10:41:25 -0600 Subject: [PATCH] Import error fix from ajax --- package.json | 2 +- src/index.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index eaf872d..3089c3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "apollo-absinthe-upload-link", - "version": "1.0.2", + "version": "1.0.3", "description": "A network interface for Apollo that enables file-uploading to Absinthe back ends.", "main": "src/index.js", "repository": "https://github.com/bytewitchcraft/apollo-absinthe-upload-link", diff --git a/src/index.js b/src/index.js index 4eec35f..1edf8b4 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,9 @@ import { HttpLink } from 'apollo-link-http' import { ApolloLink, concat } from 'apollo-link' import { printAST } from 'apollo-client' -import { ajax } from 'rxjs/observable/dom/ajax' +import { Observable } from 'rxjs/Observable'; +import 'rxjs/add/observable/dom/ajax'; +import 'rxjs/add/operator/map'; import { pipe, append, join } from 'ramda' const isObject = value => value !== null && typeof value === 'object' @@ -52,7 +54,7 @@ const createUploadMiddleware = ({ uri }) => formData.append('variables', JSON.stringify(variables)) files.forEach(({ name, file }) => formData.append(name, file)) - return ajax({ + return Observable.ajax({ url: uri, body: formData, method: 'POST',