@aws-amplify/api-graphql 4.0.1-console-preview.047a1dd.0 → 4.0.1-console-preview.4432977.0
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/lib/GraphQLAPI.d.ts +1 -1
- package/lib/Providers/AWSAppSyncRealTimeProvider/index.js +5 -5
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/lib/internals/InternalGraphQLAPI.d.ts +1 -1
- package/lib/internals/InternalGraphQLAPI.js +3 -3
- package/lib/tsconfig.tsbuildinfo +829 -827
- package/lib/types/index.d.ts +5 -4
- package/lib/types/index.js +3 -0
- package/lib-esm/GraphQLAPI.d.ts +1 -1
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +5 -5
- package/lib-esm/index.d.ts +1 -0
- package/lib-esm/index.js +1 -0
- package/lib-esm/internals/InternalGraphQLAPI.d.ts +1 -1
- package/lib-esm/internals/InternalGraphQLAPI.js +3 -3
- package/lib-esm/tsconfig.tsbuildinfo +829 -827
- package/lib-esm/types/index.d.ts +5 -4
- package/lib-esm/types/index.js +1 -0
- package/package.json +6 -5
- package/src/GraphQLAPI.ts +1 -1
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +5 -5
- package/src/index.ts +2 -0
- package/src/internals/InternalGraphQLAPI.ts +4 -4
- package/src/types/index.ts +5 -6
package/lib-esm/types/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Source, DocumentNode, GraphQLError } from 'graphql';
|
|
2
2
|
export { OperationTypeNode } from 'graphql';
|
|
3
|
-
import { Observable } from '
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
4
|
import { DocumentType } from '@aws-amplify/api-rest';
|
|
5
|
-
|
|
5
|
+
import { GraphQLAuthModeKeys } from '@aws-amplify/core/internals/utils';
|
|
6
|
+
export { CONTROL_MSG, ConnectionState } from './PubSub';
|
|
6
7
|
/**
|
|
7
8
|
* Loose/Unknown options for raw GraphQLAPICategory `graphql()`.
|
|
8
9
|
*/
|
|
@@ -72,7 +73,7 @@ export declare type GraphqlSubscriptionMessage<T> = {
|
|
|
72
73
|
};
|
|
73
74
|
export interface AWSAppSyncRealTimeProviderOptions {
|
|
74
75
|
appSyncGraphqlEndpoint?: string;
|
|
75
|
-
authenticationType?:
|
|
76
|
+
authenticationType?: GraphQLAuthModeKeys;
|
|
76
77
|
query?: string;
|
|
77
78
|
variables?: Record<string, unknown>;
|
|
78
79
|
apiKey?: string;
|
|
@@ -104,7 +105,7 @@ export declare type GraphQLOperation = Source | string;
|
|
|
104
105
|
export interface GraphQLOptionsV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string> {
|
|
105
106
|
query: TYPED_GQL_STRING | DocumentNode;
|
|
106
107
|
variables?: GraphQLVariablesV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
|
|
107
|
-
authMode?:
|
|
108
|
+
authMode?: GraphQLAuthModeKeys;
|
|
108
109
|
authToken?: string;
|
|
109
110
|
/**
|
|
110
111
|
* @deprecated This property should not be used
|
package/lib-esm/types/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api-graphql",
|
|
3
|
-
"version": "4.0.1-console-preview.
|
|
3
|
+
"version": "4.0.1-console-preview.4432977.0+4432977",
|
|
4
4
|
"description": "Api-graphql category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -50,11 +50,12 @@
|
|
|
50
50
|
"internals"
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@aws-amplify/api-rest": "4.0.1-console-preview.
|
|
54
|
-
"@aws-amplify/auth": "6.0.1-console-preview.
|
|
55
|
-
"@aws-amplify/core": "6.0.1-console-preview.
|
|
53
|
+
"@aws-amplify/api-rest": "4.0.1-console-preview.4432977.0+4432977",
|
|
54
|
+
"@aws-amplify/auth": "6.0.1-console-preview.4432977.0+4432977",
|
|
55
|
+
"@aws-amplify/core": "6.0.1-console-preview.4432977.0+4432977",
|
|
56
56
|
"@aws-sdk/types": "3.387.0",
|
|
57
57
|
"graphql": "15.8.0",
|
|
58
|
+
"rxjs": "^7.8.1",
|
|
58
59
|
"tslib": "^1.8.0",
|
|
59
60
|
"uuid": "^3.2.1",
|
|
60
61
|
"zen-observable-ts": "0.8.19"
|
|
@@ -112,5 +113,5 @@
|
|
|
112
113
|
"lib-esm"
|
|
113
114
|
]
|
|
114
115
|
},
|
|
115
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "4432977940335c2e9fe48cc9415350c4c44ef0eb"
|
|
116
117
|
}
|
package/src/GraphQLAPI.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { GraphQLOptions, GraphQLResult } from './types';
|
|
4
4
|
import { InternalGraphQLAPIClass } from './internals';
|
|
5
|
-
import Observable from '
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
export const graphqlOperation = (
|
|
8
8
|
query,
|
|
@@ -561,11 +561,11 @@ export class AWSAppSyncRealTimeProvider {
|
|
|
561
561
|
subscriptionReadyCallback();
|
|
562
562
|
}
|
|
563
563
|
if (startAckTimeoutId) clearTimeout(startAckTimeoutId);
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
564
|
+
dispatchApiEvent({
|
|
565
|
+
event: CONTROL_MSG.SUBSCRIPTION_ACK,
|
|
566
|
+
data: { query, variables },
|
|
567
|
+
message: 'Connection established for subscription',
|
|
568
|
+
});
|
|
569
569
|
const subscriptionState = SUBSCRIPTION_STATUS.CONNECTED;
|
|
570
570
|
if (observer) {
|
|
571
571
|
this.subscriptionObserverMap.set(id, {
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
GraphQLError,
|
|
9
9
|
OperationTypeNode,
|
|
10
10
|
} from 'graphql';
|
|
11
|
-
import Observable from '
|
|
11
|
+
import { Observable } from 'rxjs';
|
|
12
12
|
import { Amplify, Cache, fetchAuthSession } from '@aws-amplify/core';
|
|
13
13
|
import {
|
|
14
14
|
CustomUserAgentDetails,
|
|
@@ -280,9 +280,9 @@ export class InternalGraphQLAPIClass {
|
|
|
280
280
|
return this.appSyncRealTime.subscribe({
|
|
281
281
|
query: print(query as DocumentNode),
|
|
282
282
|
variables,
|
|
283
|
-
appSyncGraphqlEndpoint: AppSync
|
|
284
|
-
region: AppSync
|
|
285
|
-
authenticationType: AppSync
|
|
283
|
+
appSyncGraphqlEndpoint: AppSync?.endpoint,
|
|
284
|
+
region: AppSync?.region,
|
|
285
|
+
authenticationType: AppSync?.defaultAuthMode,
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
288
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { Source, DocumentNode, GraphQLError } from 'graphql';
|
|
4
4
|
export { OperationTypeNode } from 'graphql';
|
|
5
|
-
import { Observable } from '
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
import { DocumentType } from '@aws-amplify/api-rest';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { GraphQLAuthModeKeys } from '@aws-amplify/core/internals/utils';
|
|
9
|
+
export { CONTROL_MSG, ConnectionState } from './PubSub';
|
|
10
10
|
/**
|
|
11
11
|
* Loose/Unknown options for raw GraphQLAPICategory `graphql()`.
|
|
12
12
|
*/
|
|
13
13
|
export interface GraphQLOptions {
|
|
14
14
|
query: string | DocumentNode;
|
|
15
15
|
variables?: Record<string, DocumentType>;
|
|
16
|
-
// authMode?: GraphQLAuthMode;
|
|
17
16
|
authMode?: string;
|
|
18
17
|
authToken?: string;
|
|
19
18
|
/**
|
|
@@ -84,7 +83,7 @@ export type GraphqlSubscriptionMessage<T> = {
|
|
|
84
83
|
|
|
85
84
|
export interface AWSAppSyncRealTimeProviderOptions {
|
|
86
85
|
appSyncGraphqlEndpoint?: string;
|
|
87
|
-
authenticationType?:
|
|
86
|
+
authenticationType?: GraphQLAuthModeKeys;
|
|
88
87
|
query?: string;
|
|
89
88
|
variables?: Record<string, unknown>;
|
|
90
89
|
apiKey?: string;
|
|
@@ -123,7 +122,7 @@ export interface GraphQLOptionsV6<
|
|
|
123
122
|
> {
|
|
124
123
|
query: TYPED_GQL_STRING | DocumentNode;
|
|
125
124
|
variables?: GraphQLVariablesV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
|
|
126
|
-
authMode?:
|
|
125
|
+
authMode?: GraphQLAuthModeKeys;
|
|
127
126
|
authToken?: string;
|
|
128
127
|
/**
|
|
129
128
|
* @deprecated This property should not be used
|