@aws-amplify/api 6.0.3-unstable.032ab8e.0 → 6.0.3-unstable.4953a58.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/dist/esm/index.d.ts
CHANGED
|
@@ -2,4 +2,7 @@ export { GraphQLQuery, GraphQLSubscription, SelectionSet } from './types';
|
|
|
2
2
|
export { generateClient } from './API';
|
|
3
3
|
export { GraphQLAuthError, ConnectionState } from '@aws-amplify/api-graphql';
|
|
4
4
|
export type { GraphQLResult, GraphQLReturnType, CONNECTION_STATE_CHANGE, } from '@aws-amplify/api-graphql';
|
|
5
|
+
import type { V6Client } from '@aws-amplify/api-graphql';
|
|
6
|
+
type Client<T extends Record<any, any> = never> = V6Client<T>;
|
|
7
|
+
export { Client };
|
|
5
8
|
export { get, put, post, del, head, patch, isCancelError, } from '@aws-amplify/api-rest';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AWSAppSyncRealTimeProvider, GraphQLOperation, GraphQLOptions, GraphQLResult, OperationTypeNode, GraphQLQuery, GraphQLSubscription } from '@aws-amplify/api-graphql';
|
|
2
2
|
import { CustomUserAgentDetails } from '@aws-amplify/core/internals/utils';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import { CustomHeaders } from '@aws-amplify/data-schema-types';
|
|
4
5
|
/**
|
|
5
6
|
* @deprecated
|
|
6
7
|
* Use RestApi or GraphQLAPI to reduce your application bundle size
|
|
@@ -26,9 +27,7 @@ export declare class InternalAPIClass {
|
|
|
26
27
|
* @param [additionalHeaders] - headers to merge in after any `graphql_headers` set in the config
|
|
27
28
|
* @returns An Observable if queryType is 'subscription', else a promise of the graphql result from the query.
|
|
28
29
|
*/
|
|
29
|
-
graphql<T>(options: GraphQLOptions, additionalHeaders?: {
|
|
30
|
-
[key: string]: string;
|
|
31
|
-
}, customUserAgentDetails?: CustomUserAgentDetails): T extends GraphQLQuery<T> ? Promise<GraphQLResult<T>> : T extends GraphQLSubscription<T> ? Observable<{
|
|
30
|
+
graphql<T>(options: GraphQLOptions, additionalHeaders?: CustomHeaders, customUserAgentDetails?: CustomUserAgentDetails): T extends GraphQLQuery<T> ? Promise<GraphQLResult<T>> : T extends GraphQLSubscription<T> ? Observable<{
|
|
32
31
|
provider: AWSAppSyncRealTimeProvider;
|
|
33
32
|
value: GraphQLResult<T>;
|
|
34
33
|
}> : Promise<GraphQLResult<any>> | Observable<object>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/api",
|
|
3
|
-
"version": "6.0.3-unstable.
|
|
3
|
+
"version": "6.0.3-unstable.4953a58.0+4953a58",
|
|
4
4
|
"description": "Api category of aws-amplify",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.mjs",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"server"
|
|
82
82
|
],
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@aws-amplify/api-graphql": "4.0.3-unstable.
|
|
85
|
-
"@aws-amplify/api-rest": "4.0.3-unstable.
|
|
84
|
+
"@aws-amplify/api-graphql": "4.0.3-unstable.4953a58.0+4953a58",
|
|
85
|
+
"@aws-amplify/api-rest": "4.0.3-unstable.4953a58.0+4953a58",
|
|
86
86
|
"tslib": "^2.5.0"
|
|
87
87
|
},
|
|
88
88
|
"jest": {
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"__tests__"
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "4953a584b95db10dd528c6d1814d8bd47a33ee3d"
|
|
139
139
|
}
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,14 @@ export type {
|
|
|
12
12
|
CONNECTION_STATE_CHANGE,
|
|
13
13
|
} from '@aws-amplify/api-graphql';
|
|
14
14
|
|
|
15
|
+
import type { V6Client } from '@aws-amplify/api-graphql';
|
|
16
|
+
|
|
17
|
+
// explicitly defaulting to `never` here resolves
|
|
18
|
+
// TS2589: Type instantiation is excessively deep and possibly infinite.
|
|
19
|
+
// When this type is used without a generic type arg, i.e. `let client: Client`
|
|
20
|
+
type Client<T extends Record<any, any> = never> = V6Client<T>;
|
|
21
|
+
export { Client };
|
|
22
|
+
|
|
15
23
|
export {
|
|
16
24
|
get,
|
|
17
25
|
put,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
CustomUserAgentDetails,
|
|
18
18
|
} from '@aws-amplify/core/internals/utils';
|
|
19
19
|
import { Observable } from 'rxjs';
|
|
20
|
+
import { CustomHeaders } from '@aws-amplify/data-schema-types';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* NOTE!
|
|
@@ -66,7 +67,7 @@ export class InternalAPIClass {
|
|
|
66
67
|
*/
|
|
67
68
|
graphql<T>(
|
|
68
69
|
options: GraphQLOptions,
|
|
69
|
-
additionalHeaders?:
|
|
70
|
+
additionalHeaders?: CustomHeaders,
|
|
70
71
|
customUserAgentDetails?: CustomUserAgentDetails
|
|
71
72
|
): T extends GraphQLQuery<T>
|
|
72
73
|
? Promise<GraphQLResult<T>>
|
|
@@ -78,7 +79,7 @@ export class InternalAPIClass {
|
|
|
78
79
|
: Promise<GraphQLResult<any>> | Observable<object>;
|
|
79
80
|
graphql<T = any>(
|
|
80
81
|
options: GraphQLOptions,
|
|
81
|
-
additionalHeaders?:
|
|
82
|
+
additionalHeaders?: CustomHeaders,
|
|
82
83
|
customUserAgentDetails?: CustomUserAgentDetails
|
|
83
84
|
): Promise<GraphQLResult<any>> | Observable<object> {
|
|
84
85
|
const apiUserAgentDetails: CustomUserAgentDetails = {
|