@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.
@@ -1,8 +1,9 @@
1
1
  import { Source, DocumentNode, GraphQLError } from 'graphql';
2
2
  export { OperationTypeNode } from 'graphql';
3
- import { Observable } from 'zen-observable-ts';
3
+ import { Observable } from 'rxjs';
4
4
  import { DocumentType } from '@aws-amplify/api-rest';
5
- export declare type GraphQLAuthMode = 'AWS_IAM' | 'COGNITO_USERPOOLS' | 'API_KEY';
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?: GraphQLAuthMode;
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?: GraphQLAuthMode;
108
+ authMode?: GraphQLAuthModeKeys;
108
109
  authToken?: string;
109
110
  /**
110
111
  * @deprecated This property should not be used
@@ -1,3 +1,4 @@
1
+ export { CONTROL_MSG, ConnectionState } from './PubSub';
1
2
  export var GraphQLAuthError;
2
3
  (function (GraphQLAuthError) {
3
4
  GraphQLAuthError["NO_API_KEY"] = "No api-key configured";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/api-graphql",
3
- "version": "4.0.1-console-preview.047a1dd.0+047a1dd",
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.047a1dd.0+047a1dd",
54
- "@aws-amplify/auth": "6.0.1-console-preview.047a1dd.0+047a1dd",
55
- "@aws-amplify/core": "6.0.1-console-preview.047a1dd.0+047a1dd",
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": "047a1dd83d54c8f3ee74e0766d96c6a3b9f97f90"
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 'zen-observable-ts';
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
- // dispatchApiEvent(
565
- // CONTROL_MSG.SUBSCRIPTION_ACK,
566
- // { query, variables },
567
- // 'Connection established for subscription'
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
@@ -3,3 +3,5 @@
3
3
 
4
4
  export { GraphQLAPI, GraphQLAPIClass, graphqlOperation } from './GraphQLAPI';
5
5
  export * from './types';
6
+
7
+ export { CONNECTION_STATE_CHANGE } from './Providers/constants';
@@ -8,7 +8,7 @@ import {
8
8
  GraphQLError,
9
9
  OperationTypeNode,
10
10
  } from 'graphql';
11
- import Observable from 'zen-observable-ts';
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.endpoint,
284
- region: AppSync.region,
285
- authenticationType: AppSync.defaultAuthMode,
283
+ appSyncGraphqlEndpoint: AppSync?.endpoint,
284
+ region: AppSync?.region,
285
+ authenticationType: AppSync?.defaultAuthMode,
286
286
  });
287
287
  }
288
288
  }
@@ -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 'zen-observable-ts';
5
+ import { Observable } from 'rxjs';
6
6
 
7
7
  import { DocumentType } from '@aws-amplify/api-rest';
8
- export type GraphQLAuthMode = 'AWS_IAM' | 'COGNITO_USERPOOLS' | 'API_KEY';
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?: GraphQLAuthMode;
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?: GraphQLAuthMode;
125
+ authMode?: GraphQLAuthModeKeys;
127
126
  authToken?: string;
128
127
  /**
129
128
  * @deprecated This property should not be used