@rxdi/graphql-client 0.7.130 → 0.7.134
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/dist/graphq.helpers.js +1 -2
- package/dist/graphql.injection.js +0 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +6 -7
- package/package.json +2 -2
package/dist/graphq.helpers.js
CHANGED
|
@@ -5,8 +5,7 @@ const core_1 = require("@rxdi/core");
|
|
|
5
5
|
function importQuery(search) {
|
|
6
6
|
let result;
|
|
7
7
|
const DOCUMENTS = core_1.Container.get('graphql-documents');
|
|
8
|
-
Object.keys(DOCUMENTS)
|
|
9
|
-
.filter(doc => {
|
|
8
|
+
Object.keys(DOCUMENTS).filter((doc) => {
|
|
10
9
|
if (doc.indexOf(search) !== -1) {
|
|
11
10
|
result = DOCUMENTS[doc];
|
|
12
11
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ModuleWithServices } from
|
|
2
|
-
import { GraphqlModuleConfig } from
|
|
1
|
+
import { ModuleWithServices } from '@rxdi/core';
|
|
2
|
+
import { GraphqlModuleConfig } from './graphql.injection';
|
|
3
3
|
export declare class GraphqlModule {
|
|
4
4
|
static forRoot({ uri, pubsub, onRequest, cache, apolloRequestHandler, cancelPendingRequests, apolloClientOptions, }?: GraphqlModuleConfig, documents?: {}): ModuleWithServices;
|
|
5
5
|
}
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export { QueryOptions, SubscriptionOptions, MutationOptions
|
|
9
|
-
export { IntrospectionFragmentMatcher, InMemoryCache
|
|
10
|
-
export { DataProxy } from
|
|
6
|
+
export * from './graphql.injection';
|
|
7
|
+
export * from './graphq.helpers';
|
|
8
|
+
export { QueryOptions, SubscriptionOptions, MutationOptions } from 'apollo-client';
|
|
9
|
+
export { IntrospectionFragmentMatcher, InMemoryCache } from 'apollo-cache-inmemory';
|
|
10
|
+
export { DataProxy } from 'apollo-cache';
|
|
11
|
+
export { GraphQLRequest } from 'apollo-link';
|
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ let GraphqlModule = GraphqlModule_1 = class GraphqlModule {
|
|
|
61
61
|
headers,
|
|
62
62
|
};
|
|
63
63
|
})),
|
|
64
|
-
new apollo_link_1.ApolloLink(typeof apolloRequestHandler ===
|
|
64
|
+
new apollo_link_1.ApolloLink(typeof apolloRequestHandler === 'function'
|
|
65
65
|
? apolloRequestHandler
|
|
66
66
|
: (operation, forward) => {
|
|
67
67
|
/* Start cancel request */
|
|
@@ -101,20 +101,19 @@ let GraphqlModule = GraphqlModule_1 = class GraphqlModule {
|
|
|
101
101
|
}),
|
|
102
102
|
]), (0, apollo_link_1.split)(({ query }) => {
|
|
103
103
|
const { kind, operation } = (0, apollo_utilities_1.getMainDefinition)(query);
|
|
104
|
-
return
|
|
105
|
-
operation === "subscription");
|
|
104
|
+
return kind === 'OperationDefinition' && operation === 'subscription';
|
|
106
105
|
}, (() => {
|
|
107
106
|
const wsLink = new apollo_link_ws_1.WebSocketLink(new subscriptions_transport_ws_1.SubscriptionClient(pubsub, {
|
|
108
107
|
lazy: true,
|
|
109
108
|
connectionParams: () => ({
|
|
110
109
|
get authorization() {
|
|
111
|
-
return headers[
|
|
110
|
+
return headers['authorization'];
|
|
112
111
|
},
|
|
113
112
|
}),
|
|
114
113
|
connectionCallback: (error) => {
|
|
115
|
-
console.error(
|
|
116
|
-
if ((error === null || error === void 0 ? void 0 : error[
|
|
117
|
-
wsLink[
|
|
114
|
+
console.error('[Subscription]: ', error);
|
|
115
|
+
if ((error === null || error === void 0 ? void 0 : error['message']) === 'Unauthorized') {
|
|
116
|
+
wsLink['subscriptionClient'].close(false, false);
|
|
118
117
|
}
|
|
119
118
|
},
|
|
120
119
|
reconnect: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdi/graphql-client",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.134",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"author": "Kristiyan Tachev",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"typescript": "^4.3.5",
|
|
26
26
|
"graphql": "^14.5.8",
|
|
27
|
-
"@rxdi/core": "^0.7.
|
|
27
|
+
"@rxdi/core": "^0.7.133"
|
|
28
28
|
},
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"module": "./dist/index.js",
|