graphql-react
Advanced tools
Comparing version 4.2.0 to 5.0.0
# graphql-react changelog | ||
## 5.0.0 | ||
### Major | ||
- Updated the [`extract-files`](https://npm.im/extract-files) dependency to v5: | ||
- The original operation object is no longer modified when it contains files. | ||
- If the same file is used in multiple locations of an operation it is only uploaded once. | ||
### Patch | ||
- Updated dependencies. | ||
- Removed a redundant `.prettierignore` entry. | ||
- Added tests for the internal `graphqlFetchOptions` function. | ||
## 4.2.0 | ||
@@ -4,0 +18,0 @@ |
@@ -6,3 +6,3 @@ 'use strict' | ||
var _extractFiles = require('extract-files') | ||
var _extractFiles2 = require('extract-files') | ||
@@ -17,22 +17,22 @@ function graphqlFetchOptions(operation) { | ||
} | ||
var files = (0, _extractFiles.extractFiles)(operation) | ||
var operationJSON = JSON.stringify(operation) | ||
if (files.length) { | ||
var _extractFiles = (0, _extractFiles2.extractFiles)(operation), | ||
clone = _extractFiles.clone, | ||
files = _extractFiles.files | ||
var operationJSON = JSON.stringify(clone) | ||
if (files.size) { | ||
var form = new FormData() | ||
form.append('operations', operationJSON) | ||
form.append( | ||
'map', | ||
JSON.stringify( | ||
files.reduce(function(map, _ref, index) { | ||
var path = _ref.path | ||
map['' + index] = [path] | ||
return map | ||
}, {}) | ||
) | ||
) | ||
files.forEach(function(_ref2, index) { | ||
var file = _ref2.file | ||
return form.append(index, file, file.name) | ||
var map = {} | ||
var i = 0 | ||
files.forEach(function(paths) { | ||
map[++i] = paths | ||
}) | ||
form.append('map', JSON.stringify(map)) | ||
i = 0 | ||
files.forEach(function(paths, file) { | ||
form.append(++i, file, file.name) | ||
}) | ||
fetchOptions.body = form | ||
@@ -39,0 +39,0 @@ } else { |
{ | ||
"name": "graphql-react", | ||
"version": "4.2.0", | ||
"version": "5.0.0", | ||
"description": "A lightweight GraphQL client for React.", | ||
@@ -40,4 +40,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@babel/runtime": "^7.1.5", | ||
"extract-files": "^4.1.0", | ||
"@babel/runtime": "^7.2.0", | ||
"extract-files": "^5.0.0", | ||
"fast-deep-equal": "^2.0.1", | ||
@@ -50,8 +50,8 @@ "fnv1a": "^1.0.1", | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.5", | ||
"@babel/core": "^7.1.6", | ||
"@babel/plugin-proposal-class-properties": "^7.1.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.1.0", | ||
"@babel/preset-env": "^7.1.6", | ||
"@babel/cli": "^7.2.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/plugin-proposal-class-properties": "^7.2.1", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.2.0", | ||
"@babel/plugin-transform-runtime": "^7.2.0", | ||
"@babel/preset-env": "^7.2.0", | ||
"@babel/preset-react": "^7.0.0", | ||
@@ -61,4 +61,4 @@ "babel-eslint": "^10.0.1", | ||
"capture-stdout": "^1.0.0", | ||
"cross-fetch": "^2.2.3", | ||
"eslint": "^5.9.0", | ||
"cross-fetch": "^3.0.0", | ||
"eslint": "^5.10.0", | ||
"eslint-config-env": "^2.0.0", | ||
@@ -73,3 +73,3 @@ "eslint-config-prettier": "^3.3.0", | ||
"graphql-api-koa": "^2.0.0", | ||
"husky": "^1.2.0", | ||
"husky": "^1.3.0", | ||
"jsdoc-md": "^1.7.0", | ||
@@ -83,3 +83,3 @@ "koa": "^2.6.2", | ||
"size-limit": "^0.21.0", | ||
"tap": "^12.1.0", | ||
"tap": "^12.1.1", | ||
"watch": "^1.0.2" | ||
@@ -86,0 +86,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67786
859
+ Addedextract-files@5.0.1(transitive)
- Removedextract-files@4.1.0(transitive)
Updated@babel/runtime@^7.2.0
Updatedextract-files@^5.0.0