@graphql-tools/links 8.2.1-alpha-06eec860.0 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -4
- package/index.mjs +2 -4
- package/package.json +3 -4
package/index.js
CHANGED
|
@@ -12,7 +12,6 @@ const utilities = require('@apollo/client/utilities');
|
|
|
12
12
|
const core$1 = require('@apollo/client/core');
|
|
13
13
|
const utils = require('@graphql-tools/utils');
|
|
14
14
|
const graphql = require('graphql');
|
|
15
|
-
const isPromise = _interopDefault(require('is-promise'));
|
|
16
15
|
|
|
17
16
|
function getFinalPromise(object) {
|
|
18
17
|
return Promise.resolve(object).then(resolvedObject => {
|
|
@@ -100,15 +99,14 @@ const GraphQLUpload = new graphql.GraphQLScalarType({
|
|
|
100
99
|
name: 'Upload',
|
|
101
100
|
description: 'The `Upload` scalar type represents a file upload.',
|
|
102
101
|
parseValue: (value) => {
|
|
103
|
-
if (value != null &&
|
|
102
|
+
if (value != null && 'promise' in value) {
|
|
104
103
|
// graphql-upload v10
|
|
105
104
|
return value.promise;
|
|
106
105
|
}
|
|
107
|
-
else
|
|
106
|
+
else {
|
|
108
107
|
// graphql-upload v9
|
|
109
108
|
return value;
|
|
110
109
|
}
|
|
111
|
-
throw new graphql.GraphQLError('Upload value invalid.');
|
|
112
110
|
},
|
|
113
111
|
// serialization requires to support schema stitching
|
|
114
112
|
serialize: value => value,
|
package/index.mjs
CHANGED
|
@@ -6,7 +6,6 @@ import { Observable } from '@apollo/client/utilities';
|
|
|
6
6
|
import { toPromise } from '@apollo/client/core';
|
|
7
7
|
import { getOperationASTFromRequest, observableToAsyncIterable } from '@graphql-tools/utils';
|
|
8
8
|
import { GraphQLScalarType, GraphQLError } from 'graphql';
|
|
9
|
-
import isPromise from 'is-promise';
|
|
10
9
|
|
|
11
10
|
function getFinalPromise(object) {
|
|
12
11
|
return Promise.resolve(object).then(resolvedObject => {
|
|
@@ -94,15 +93,14 @@ const GraphQLUpload = new GraphQLScalarType({
|
|
|
94
93
|
name: 'Upload',
|
|
95
94
|
description: 'The `Upload` scalar type represents a file upload.',
|
|
96
95
|
parseValue: (value) => {
|
|
97
|
-
if (value != null &&
|
|
96
|
+
if (value != null && 'promise' in value) {
|
|
98
97
|
// graphql-upload v10
|
|
99
98
|
return value.promise;
|
|
100
99
|
}
|
|
101
|
-
else
|
|
100
|
+
else {
|
|
102
101
|
// graphql-upload v9
|
|
103
102
|
return value;
|
|
104
103
|
}
|
|
105
|
-
throw new GraphQLError('Upload value invalid.');
|
|
106
104
|
},
|
|
107
105
|
// serialization requires to support schema stitching
|
|
108
106
|
serialize: value => value,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/links",
|
|
3
|
-
"version": "8.2.1
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@graphql-tools/delegate": "8.4.1
|
|
12
|
-
"@graphql-tools/utils": "8.
|
|
11
|
+
"@graphql-tools/delegate": "^8.4.1",
|
|
12
|
+
"@graphql-tools/utils": "^8.5.1",
|
|
13
13
|
"apollo-upload-client": "16.0.0",
|
|
14
14
|
"cross-fetch": "3.1.4",
|
|
15
15
|
"form-data": "4.0.0",
|
|
16
|
-
"is-promise": "4.0.0",
|
|
17
16
|
"tslib": "~2.3.0"
|
|
18
17
|
},
|
|
19
18
|
"repository": {
|