@graphql-tools/links 10.0.0-alpha-20250905112433-43883b537970d1a211468577d2670104446dd070 → 10.0.0-alpha-20250905115734-582a1deb8da61a7a15b821d1b5a26a7cd2d0614a
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.
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createServerHttpLink = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const createUploadLink_mjs_1 = tslib_1.__importDefault(require("apollo-upload-client/createUploadLink.mjs"));
|
|
6
5
|
const formDataAppendFile_mjs_1 = tslib_1.__importDefault(require("apollo-upload-client/formDataAppendFile.mjs"));
|
|
7
6
|
const isExtractableFile_mjs_1 = tslib_1.__importDefault(require("apollo-upload-client/isExtractableFile.mjs"));
|
|
7
|
+
const UploadHttpLink_mjs_1 = tslib_1.__importDefault(require("apollo-upload-client/UploadHttpLink.mjs"));
|
|
8
8
|
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
9
9
|
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
10
10
|
const apolloImport = tslib_1.__importStar(require("@apollo/client"));
|
|
11
11
|
const AwaitVariablesLink_js_1 = require("./AwaitVariablesLink.js");
|
|
12
12
|
const apollo = apolloImport?.default ?? apolloImport;
|
|
13
|
-
const createServerHttpLink = (options) => apollo.concat(new AwaitVariablesLink_js_1.AwaitVariablesLink(),
|
|
13
|
+
const createServerHttpLink = (options) => apollo.concat(new AwaitVariablesLink_js_1.AwaitVariablesLink(), new UploadHttpLink_mjs_1.default({
|
|
14
14
|
...options,
|
|
15
15
|
fetch: node_fetch_1.default,
|
|
16
16
|
FormData: form_data_1.default,
|
package/cjs/linkToExecutor.js
CHANGED
|
@@ -9,7 +9,6 @@ function linkToExecutor(link) {
|
|
|
9
9
|
return function executorFromLink(request) {
|
|
10
10
|
const observable = apollo.execute(link, {
|
|
11
11
|
query: request.document,
|
|
12
|
-
operationName: request.operationName,
|
|
13
12
|
variables: request.variables,
|
|
14
13
|
context: {
|
|
15
14
|
graphqlContext: request.context,
|
|
@@ -17,11 +16,11 @@ function linkToExecutor(link) {
|
|
|
17
16
|
clientAwareness: {},
|
|
18
17
|
},
|
|
19
18
|
extensions: request.extensions,
|
|
20
|
-
});
|
|
19
|
+
}, {});
|
|
21
20
|
const operationAst = (0, utils_1.getOperationASTFromRequest)(request);
|
|
22
21
|
if (operationAst.operation === 'subscription') {
|
|
23
22
|
return (0, utils_1.observableToAsyncIterable)(observable);
|
|
24
23
|
}
|
|
25
|
-
return
|
|
24
|
+
return observable.toPromise();
|
|
26
25
|
};
|
|
27
26
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import createUploadLink from 'apollo-upload-client/createUploadLink.mjs';
|
|
2
1
|
import formDataAppendFile from 'apollo-upload-client/formDataAppendFile.mjs';
|
|
3
2
|
import isExtractableFile from 'apollo-upload-client/isExtractableFile.mjs';
|
|
3
|
+
import UploadHttpLink from 'apollo-upload-client/UploadHttpLink.mjs';
|
|
4
4
|
import FormData from 'form-data';
|
|
5
5
|
import fetch from 'node-fetch';
|
|
6
6
|
import * as apolloImport from '@apollo/client';
|
|
7
7
|
import { AwaitVariablesLink } from './AwaitVariablesLink.js';
|
|
8
8
|
const apollo = apolloImport?.default ?? apolloImport;
|
|
9
|
-
export const createServerHttpLink = (options) => apollo.concat(new AwaitVariablesLink(),
|
|
9
|
+
export const createServerHttpLink = (options) => apollo.concat(new AwaitVariablesLink(), new UploadHttpLink({
|
|
10
10
|
...options,
|
|
11
11
|
fetch,
|
|
12
12
|
FormData,
|
package/esm/linkToExecutor.js
CHANGED
|
@@ -5,7 +5,6 @@ export function linkToExecutor(link) {
|
|
|
5
5
|
return function executorFromLink(request) {
|
|
6
6
|
const observable = apollo.execute(link, {
|
|
7
7
|
query: request.document,
|
|
8
|
-
operationName: request.operationName,
|
|
9
8
|
variables: request.variables,
|
|
10
9
|
context: {
|
|
11
10
|
graphqlContext: request.context,
|
|
@@ -13,11 +12,11 @@ export function linkToExecutor(link) {
|
|
|
13
12
|
clientAwareness: {},
|
|
14
13
|
},
|
|
15
14
|
extensions: request.extensions,
|
|
16
|
-
});
|
|
15
|
+
}, {});
|
|
17
16
|
const operationAst = getOperationASTFromRequest(request);
|
|
18
17
|
if (operationAst.operation === 'subscription') {
|
|
19
18
|
return observableToAsyncIterable(observable);
|
|
20
19
|
}
|
|
21
|
-
return
|
|
20
|
+
return observable.toPromise();
|
|
22
21
|
};
|
|
23
22
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/links",
|
|
3
|
-
"version": "10.0.0-alpha-
|
|
3
|
+
"version": "10.0.0-alpha-20250905115734-582a1deb8da61a7a15b821d1b5a26a7cd2d0614a",
|
|
4
4
|
"description": "A set of utils for faster development of GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@apollo/client": "^
|
|
7
|
+
"@apollo/client": "^4.0.4",
|
|
8
8
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@graphql-tools/delegate": "^11.0.0",
|
|
12
12
|
"@graphql-tools/utils": "^10.9.1",
|
|
13
|
-
"apollo-upload-client": "
|
|
13
|
+
"apollo-upload-client": "^19.0.0",
|
|
14
14
|
"form-data": "^4.0.0",
|
|
15
15
|
"node-fetch": "^2.6.5",
|
|
16
16
|
"tslib": "^2.4.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as apolloImport from '@apollo/client';
|
|
2
2
|
declare const apollo: typeof apolloImport;
|
|
3
3
|
export declare class AwaitVariablesLink extends apollo.ApolloLink {
|
|
4
|
-
request(operation: apolloImport.Operation, forward: apolloImport.
|
|
4
|
+
request(operation: apolloImport.ApolloLink.Operation, forward: apolloImport.ApolloLink.ForwardFunction): apolloImport.Observable<apolloImport.ApolloLink.Result>;
|
|
5
5
|
}
|
|
6
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as apolloImport from '@apollo/client';
|
|
2
2
|
declare const apollo: typeof apolloImport;
|
|
3
3
|
export declare class AwaitVariablesLink extends apollo.ApolloLink {
|
|
4
|
-
request(operation: apolloImport.Operation, forward: apolloImport.
|
|
4
|
+
request(operation: apolloImport.ApolloLink.Operation, forward: apolloImport.ApolloLink.ForwardFunction): apolloImport.Observable<apolloImport.ApolloLink.Result>;
|
|
5
5
|
}
|
|
6
6
|
export {};
|