@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,5 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ var PubSub_1 = require("./PubSub");
4
+ exports.CONTROL_MSG = PubSub_1.CONTROL_MSG;
5
+ exports.ConnectionState = PubSub_1.ConnectionState;
3
6
  var GraphQLAuthError;
4
7
  (function (GraphQLAuthError) {
5
8
  GraphQLAuthError["NO_API_KEY"] = "No api-key configured";
@@ -1,6 +1,6 @@
1
1
  import { GraphQLOptions, GraphQLResult } from './types';
2
2
  import { InternalGraphQLAPIClass } from './internals';
3
- import Observable from 'zen-observable-ts';
3
+ import { Observable } from 'rxjs';
4
4
  export declare const graphqlOperation: (query: any, variables?: {}, authToken?: string) => {
5
5
  query: any;
6
6
  variables: {};
@@ -395,11 +395,11 @@ var AWSAppSyncRealTimeProvider = /** @class */ (function () {
395
395
  }
396
396
  if (startAckTimeoutId)
397
397
  clearTimeout(startAckTimeoutId);
398
- // dispatchApiEvent(
399
- // CONTROL_MSG.SUBSCRIPTION_ACK,
400
- // { query, variables },
401
- // 'Connection established for subscription'
402
- // );
398
+ dispatchApiEvent({
399
+ event: CONTROL_MSG.SUBSCRIPTION_ACK,
400
+ data: { query: query, variables: variables },
401
+ message: 'Connection established for subscription',
402
+ });
403
403
  var subscriptionState = SUBSCRIPTION_STATUS.CONNECTED;
404
404
  if (observer) {
405
405
  this.subscriptionObserverMap.set(id, {
@@ -1,2 +1,3 @@
1
1
  export { GraphQLAPI, GraphQLAPIClass, graphqlOperation } from './GraphQLAPI';
2
2
  export * from './types';
3
+ export { CONNECTION_STATE_CHANGE } from './Providers/constants';
package/lib-esm/index.js CHANGED
@@ -2,3 +2,4 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { GraphQLAPI, GraphQLAPIClass, graphqlOperation } from './GraphQLAPI';
4
4
  export * from './types';
5
+ export { CONNECTION_STATE_CHANGE } from './Providers/constants';
@@ -1,5 +1,5 @@
1
1
  import { OperationTypeNode } from 'graphql';
2
- import Observable from 'zen-observable-ts';
2
+ import { Observable } from 'rxjs';
3
3
  import { CustomUserAgentDetails } from '@aws-amplify/core/internals/utils';
4
4
  import { GraphQLResult, GraphQLOperation, GraphQLOptions } from '../types';
5
5
  export declare const graphqlOperation: (query: any, variables?: {}, authToken?: string) => {
@@ -233,9 +233,9 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
233
233
  return this.appSyncRealTime.subscribe({
234
234
  query: print(query),
235
235
  variables: variables,
236
- appSyncGraphqlEndpoint: AppSync.endpoint,
237
- region: AppSync.region,
238
- authenticationType: AppSync.defaultAuthMode,
236
+ appSyncGraphqlEndpoint: AppSync === null || AppSync === void 0 ? void 0 : AppSync.endpoint,
237
+ region: AppSync === null || AppSync === void 0 ? void 0 : AppSync.region,
238
+ authenticationType: AppSync === null || AppSync === void 0 ? void 0 : AppSync.defaultAuthMode,
239
239
  });
240
240
  };
241
241
  return InternalGraphQLAPIClass;