@aws-amplify/api-graphql 4.0.1-api-v6-models.ce6e561.0 → 4.0.1-api-v6-models.572a7b5.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/Providers/AWSAppSyncRealTimeProvider/index.js +3 -4
- package/lib/internals/InternalGraphQLAPI.js +3 -2
- package/lib/internals/generateModelsProperty.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/Providers/AWSAppSyncRealTimeProvider/index.js +5 -6
- package/lib-esm/internals/InternalGraphQLAPI.js +4 -3
- package/lib-esm/internals/generateModelsProperty.js +1 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -7
- package/src/Providers/AWSAppSyncRealTimeProvider/index.ts +6 -6
- package/src/internals/InternalGraphQLAPI.ts +4 -4
- package/src/internals/generateModelsProperty.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api-graphql",
|
|
3
|
-
"version": "4.0.1-api-v6-models.
|
|
3
|
+
"version": "4.0.1-api-v6-models.572a7b5.0+572a7b5",
|
|
4
4
|
"description": "Api-graphql category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -52,15 +52,14 @@
|
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@aws-amplify/amplify-api-next-types-alpha": "^0.2.0",
|
|
55
|
-
"@aws-amplify/api-rest": "4.0.1-api-v6-models.
|
|
56
|
-
"@aws-amplify/auth": "6.0.1-api-v6-models.
|
|
57
|
-
"@aws-amplify/core": "6.0.1-api-v6-models.
|
|
55
|
+
"@aws-amplify/api-rest": "4.0.1-api-v6-models.572a7b5.0+572a7b5",
|
|
56
|
+
"@aws-amplify/auth": "6.0.1-api-v6-models.572a7b5.0+572a7b5",
|
|
57
|
+
"@aws-amplify/core": "6.0.1-api-v6-models.572a7b5.0+572a7b5",
|
|
58
58
|
"@aws-sdk/types": "3.387.0",
|
|
59
59
|
"graphql": "15.8.0",
|
|
60
60
|
"rxjs": "^7.8.1",
|
|
61
61
|
"tslib": "^2.6.1",
|
|
62
|
-
"url": "0.11.0"
|
|
63
|
-
"uuid": "^3.2.1"
|
|
62
|
+
"url": "0.11.0"
|
|
64
63
|
},
|
|
65
64
|
"size-limit": [
|
|
66
65
|
{
|
|
@@ -127,5 +126,5 @@
|
|
|
127
126
|
"<rootDir>/__tests__"
|
|
128
127
|
]
|
|
129
128
|
},
|
|
130
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "572a7b56d9e87ca779038254de3d68b5c607af07"
|
|
131
130
|
}
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
import { Observable, SubscriptionLike } from 'rxjs';
|
|
4
4
|
import { GraphQLError } from 'graphql';
|
|
5
5
|
import * as url from 'url';
|
|
6
|
-
import { v4 as uuid } from 'uuid';
|
|
7
6
|
import { Buffer } from 'buffer';
|
|
8
|
-
import { Hub, fetchAuthSession } from '@aws-amplify/core';
|
|
7
|
+
import { Hub, fetchAuthSession, ConsoleLogger } from '@aws-amplify/core';
|
|
9
8
|
import { signRequest } from '@aws-amplify/core/internals/aws-client-utils';
|
|
10
9
|
import {
|
|
11
10
|
GraphQLAuthMode,
|
|
12
11
|
CustomUserAgentDetails,
|
|
13
|
-
Logger,
|
|
14
12
|
NonRetryableError,
|
|
15
13
|
USER_AGENT_HEADER,
|
|
16
14
|
getAmplifyUserAgent,
|
|
17
15
|
isNonRetryableError,
|
|
18
16
|
jitteredExponentialRetry,
|
|
19
17
|
DocumentType,
|
|
18
|
+
amplifyUuid,
|
|
19
|
+
AmplifyUrl,
|
|
20
20
|
} from '@aws-amplify/core/internals/utils';
|
|
21
21
|
|
|
22
22
|
import {
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
ReconnectionMonitor,
|
|
48
48
|
} from '../../utils/ReconnectionMonitor';
|
|
49
49
|
|
|
50
|
-
const logger = new
|
|
50
|
+
const logger = new ConsoleLogger('AWSAppSyncRealTimeProvider');
|
|
51
51
|
|
|
52
52
|
const dispatchApiEvent = payload => {
|
|
53
53
|
Hub.dispatch('api', payload, 'PubSub', AMPLIFY_SYMBOL);
|
|
@@ -210,7 +210,7 @@ export class AWSAppSyncRealTimeProvider {
|
|
|
210
210
|
observer.complete();
|
|
211
211
|
} else {
|
|
212
212
|
let subscriptionStartActive = false;
|
|
213
|
-
const subscriptionId =
|
|
213
|
+
const subscriptionId = amplifyUuid();
|
|
214
214
|
const startSubscription = () => {
|
|
215
215
|
if (!subscriptionStartActive) {
|
|
216
216
|
subscriptionStartActive = true;
|
|
@@ -968,7 +968,7 @@ export class AWSAppSyncRealTimeProvider {
|
|
|
968
968
|
{
|
|
969
969
|
headers: request.headers,
|
|
970
970
|
method: request.method,
|
|
971
|
-
url: new
|
|
971
|
+
url: new AmplifyUrl(request.url),
|
|
972
972
|
body: request.data,
|
|
973
973
|
},
|
|
974
974
|
{
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
OperationTypeNode,
|
|
10
10
|
} from 'graphql';
|
|
11
11
|
import { Observable } from 'rxjs';
|
|
12
|
-
import { AmplifyClassV6 } from '@aws-amplify/core';
|
|
12
|
+
import { AmplifyClassV6, ConsoleLogger } from '@aws-amplify/core';
|
|
13
13
|
import {
|
|
14
14
|
GraphQLAuthMode,
|
|
15
15
|
CustomUserAgentDetails,
|
|
16
|
-
ConsoleLogger as Logger,
|
|
17
16
|
getAmplifyUserAgent,
|
|
17
|
+
AmplifyUrl,
|
|
18
18
|
} from '@aws-amplify/core/internals/utils';
|
|
19
19
|
import {
|
|
20
20
|
GraphQLAuthError,
|
|
@@ -33,7 +33,7 @@ import { resolveConfig, resolveLibraryOptions } from '../utils';
|
|
|
33
33
|
|
|
34
34
|
const USER_AGENT_HEADER = 'x-amz-user-agent';
|
|
35
35
|
|
|
36
|
-
const logger = new
|
|
36
|
+
const logger = new ConsoleLogger('GraphQLAPI');
|
|
37
37
|
|
|
38
38
|
export const graphqlOperation = (
|
|
39
39
|
query,
|
|
@@ -304,7 +304,7 @@ export class InternalGraphQLAPIClass {
|
|
|
304
304
|
let response;
|
|
305
305
|
try {
|
|
306
306
|
const { body: responseBody } = await this._api.post({
|
|
307
|
-
url: new
|
|
307
|
+
url: new AmplifyUrl(endpoint),
|
|
308
308
|
options: {
|
|
309
309
|
headers,
|
|
310
310
|
body,
|
|
@@ -129,7 +129,7 @@ export function generateModelsProperty<T extends Record<any, any> = never>(
|
|
|
129
129
|
const flattenedResult = flattenItems(data)[key];
|
|
130
130
|
|
|
131
131
|
if (options?.selectionSet) {
|
|
132
|
-
return flattenedResult;
|
|
132
|
+
return { data: flattenedResult, extensions };
|
|
133
133
|
} else {
|
|
134
134
|
// TODO: refactor to avoid destructuring here
|
|
135
135
|
const [initialized] = initializeModel(
|