@graphql-mesh/apollo-link 10.0.4 → 10.0.5
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/cjs/index.js +4 -3
- package/esm/index.js +3 -3
- package/package.json +1 -1
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MeshApolloLink = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const graphql_1 = require("graphql");
|
|
5
|
-
const
|
|
6
|
+
const apolloClient = tslib_1.__importStar(require("@apollo/client"));
|
|
6
7
|
const utils_1 = require("@graphql-tools/utils");
|
|
7
8
|
const ROOT_VALUE = {};
|
|
8
9
|
function createMeshApolloRequestHandler(options) {
|
|
@@ -12,7 +13,7 @@ function createMeshApolloRequestHandler(options) {
|
|
|
12
13
|
throw new Error('GraphQL operation not found');
|
|
13
14
|
}
|
|
14
15
|
const operationFn = operationAst.operation === 'subscription' ? options.subscribe : options.execute;
|
|
15
|
-
return new
|
|
16
|
+
return new apolloClient.Observable(observer => {
|
|
16
17
|
Promise.resolve()
|
|
17
18
|
.then(async () => {
|
|
18
19
|
const results = await operationFn(operation.query, operation.variables, operation.getContext(), ROOT_VALUE, operation.operationName);
|
|
@@ -40,7 +41,7 @@ function createMeshApolloRequestHandler(options) {
|
|
|
40
41
|
});
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
class MeshApolloLink extends
|
|
44
|
+
class MeshApolloLink extends apolloClient.ApolloLink {
|
|
44
45
|
constructor(options) {
|
|
45
46
|
super(createMeshApolloRequestHandler(options));
|
|
46
47
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOperationAST } from 'graphql';
|
|
2
|
-
import
|
|
2
|
+
import * as apolloClient from '@apollo/client';
|
|
3
3
|
import { isAsyncIterable } from '@graphql-tools/utils';
|
|
4
4
|
const ROOT_VALUE = {};
|
|
5
5
|
function createMeshApolloRequestHandler(options) {
|
|
@@ -9,7 +9,7 @@ function createMeshApolloRequestHandler(options) {
|
|
|
9
9
|
throw new Error('GraphQL operation not found');
|
|
10
10
|
}
|
|
11
11
|
const operationFn = operationAst.operation === 'subscription' ? options.subscribe : options.execute;
|
|
12
|
-
return new Observable(observer => {
|
|
12
|
+
return new apolloClient.Observable(observer => {
|
|
13
13
|
Promise.resolve()
|
|
14
14
|
.then(async () => {
|
|
15
15
|
const results = await operationFn(operation.query, operation.variables, operation.getContext(), ROOT_VALUE, operation.operationName);
|
|
@@ -37,7 +37,7 @@ function createMeshApolloRequestHandler(options) {
|
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
export class MeshApolloLink extends ApolloLink {
|
|
40
|
+
export class MeshApolloLink extends apolloClient.ApolloLink {
|
|
41
41
|
constructor(options) {
|
|
42
42
|
super(createMeshApolloRequestHandler(options));
|
|
43
43
|
}
|
package/package.json
CHANGED
package/typings/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as apolloClient from '@apollo/client';
|
|
2
2
|
import { ExecuteMeshFn, SubscribeMeshFn } from '@graphql-mesh/runtime';
|
|
3
3
|
export interface MeshApolloRequestHandlerOptions {
|
|
4
4
|
execute: ExecuteMeshFn;
|
|
5
5
|
subscribe?: SubscribeMeshFn;
|
|
6
6
|
}
|
|
7
|
-
export declare class MeshApolloLink extends ApolloLink {
|
|
7
|
+
export declare class MeshApolloLink extends apolloClient.ApolloLink {
|
|
8
8
|
constructor(options: MeshApolloRequestHandlerOptions);
|
|
9
9
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as apolloClient from '@apollo/client';
|
|
2
2
|
import { ExecuteMeshFn, SubscribeMeshFn } from '@graphql-mesh/runtime';
|
|
3
3
|
export interface MeshApolloRequestHandlerOptions {
|
|
4
4
|
execute: ExecuteMeshFn;
|
|
5
5
|
subscribe?: SubscribeMeshFn;
|
|
6
6
|
}
|
|
7
|
-
export declare class MeshApolloLink extends ApolloLink {
|
|
7
|
+
export declare class MeshApolloLink extends apolloClient.ApolloLink {
|
|
8
8
|
constructor(options: MeshApolloRequestHandlerOptions);
|
|
9
9
|
}
|