@aws-amplify/api-graphql 4.0.1-console-preview.8d88eef.0 → 4.0.1-console-preview.be08038.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.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
+ var utils_1 = require("@aws-amplify/core/internals/utils");
4
5
  var internals_1 = require("./internals");
5
6
  exports.graphqlOperation = function (query, variables, authToken) {
6
7
  if (variables === void 0) { variables = {}; }
@@ -29,7 +30,10 @@ var GraphQLAPIClass = /** @class */ (function (_super) {
29
30
  * @returns An Observable if the query is a subscription query, else a promise of the graphql result.
30
31
  */
31
32
  GraphQLAPIClass.prototype.graphql = function (amplify, options, additionalHeaders) {
32
- return _super.prototype.graphql.call(this, amplify, options, additionalHeaders);
33
+ return _super.prototype.graphql.call(this, amplify, options, additionalHeaders, {
34
+ category: utils_1.Category.API,
35
+ action: utils_1.ApiAction.GraphQl
36
+ });
33
37
  };
34
38
  /**
35
39
  * Checks to see if an error thrown is from an api request cancellation
@@ -5,7 +5,6 @@ var tslib_1 = require("tslib");
5
5
  // SPDX-License-Identifier: Apache-2.0
6
6
  var rxjs_1 = require("rxjs");
7
7
  var graphql_1 = require("graphql");
8
- var url = tslib_1.__importStar(require("url"));
9
8
  var buffer_1 = require("buffer");
10
9
  var core_1 = require("@aws-amplify/core");
11
10
  var aws_client_utils_1 = require("@aws-amplify/core/internals/aws-client-utils");
@@ -699,7 +698,9 @@ var AWSAppSyncRealTimeProvider = /** @class */ (function () {
699
698
  return [2 /*return*/, undefined];
700
699
  case 1:
701
700
  handler = headerHandler[authenticationType];
702
- host = url.parse(appSyncGraphqlEndpoint !== null && appSyncGraphqlEndpoint !== void 0 ? appSyncGraphqlEndpoint : '').host;
701
+ host = appSyncGraphqlEndpoint
702
+ ? new utils_1.AmplifyUrl(appSyncGraphqlEndpoint).host
703
+ : undefined;
703
704
  logger.debug("Authenticating with " + JSON.stringify(authenticationType));
704
705
  resolvedApiKey = void 0;
705
706
  if (authenticationType === 'apiKey') {