@aws-amplify/api-graphql 3.4.8 → 3.4.9-api-v6.d339f98.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/internals/InternalGraphQLAPI.d.ts +1 -1
- package/lib/internals/InternalGraphQLAPI.js +7 -7
- package/lib/internals/InternalGraphQLAPI.js.map +1 -1
- package/lib/internals/index.d.ts +1 -0
- package/lib/internals/index.js +2 -0
- package/lib/internals/index.js.map +1 -1
- package/lib/internals/v6.d.ts +89 -0
- package/lib/internals/v6.js +100 -0
- package/lib/internals/v6.js.map +1 -0
- package/lib/types/index.d.ts +169 -0
- package/lib/types/index.js.map +1 -1
- package/lib-esm/internals/InternalGraphQLAPI.d.ts +1 -1
- package/lib-esm/internals/InternalGraphQLAPI.js +7 -7
- package/lib-esm/internals/InternalGraphQLAPI.js.map +1 -1
- package/lib-esm/internals/index.d.ts +1 -0
- package/lib-esm/internals/index.js +1 -0
- package/lib-esm/internals/index.js.map +1 -1
- package/lib-esm/internals/v6.d.ts +89 -0
- package/lib-esm/internals/v6.js +97 -0
- package/lib-esm/internals/v6.js.map +1 -0
- package/lib-esm/types/index.d.ts +169 -0
- package/lib-esm/types/index.js.map +1 -1
- package/package.json +13 -9
- package/src/internals/InternalGraphQLAPI.ts +21 -7
- package/src/internals/index.ts +2 -0
- package/src/internals/v6.ts +106 -0
- package/src/types/index.ts +212 -2
|
@@ -16,7 +16,7 @@ export declare class InternalGraphQLAPIClass {
|
|
|
16
16
|
*/
|
|
17
17
|
private _options;
|
|
18
18
|
private _api;
|
|
19
|
-
|
|
19
|
+
InternalAuth: import("@aws-amplify/auth/lib-esm/internals/InternalAuth").InternalAuthClass;
|
|
20
20
|
Cache: import("@aws-amplify/cache/lib-esm/types").ICache;
|
|
21
21
|
Credentials: import("@aws-amplify/core").CredentialsClass;
|
|
22
22
|
/**
|
|
@@ -6,7 +6,7 @@ var tslib_1 = require("tslib");
|
|
|
6
6
|
var graphql_1 = require("graphql");
|
|
7
7
|
var core_1 = require("@aws-amplify/core");
|
|
8
8
|
var internals_1 = require("@aws-amplify/pubsub/internals");
|
|
9
|
-
var
|
|
9
|
+
var internals_2 = require("@aws-amplify/auth/internals");
|
|
10
10
|
var cache_1 = require("@aws-amplify/cache");
|
|
11
11
|
var types_1 = require("../types");
|
|
12
12
|
var api_rest_1 = require("@aws-amplify/api-rest");
|
|
@@ -30,7 +30,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
30
30
|
*/
|
|
31
31
|
function InternalGraphQLAPIClass(options) {
|
|
32
32
|
this._api = null;
|
|
33
|
-
this.
|
|
33
|
+
this.InternalAuth = internals_2.InternalAuth;
|
|
34
34
|
this.Cache = cache_1.Cache;
|
|
35
35
|
this.Credentials = core_1.Credentials;
|
|
36
36
|
this._options = options;
|
|
@@ -79,7 +79,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
79
79
|
return Promise.reject('API not configured');
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
InternalGraphQLAPIClass.prototype._headerBasedAuth = function (defaultAuthenticationType, additionalHeaders) {
|
|
82
|
+
InternalGraphQLAPIClass.prototype._headerBasedAuth = function (defaultAuthenticationType, additionalHeaders, customUserAgentDetails) {
|
|
83
83
|
if (additionalHeaders === void 0) { additionalHeaders = {}; }
|
|
84
84
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
85
85
|
var _a, aws_appsync_authenticationType, apiKey, authenticationType, headers, _b, credentialsOK, token, federatedInfo, currentUser, e_1, session, e_2;
|
|
@@ -123,7 +123,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
123
123
|
if (!federatedInfo) return [3 /*break*/, 6];
|
|
124
124
|
token = federatedInfo.token;
|
|
125
125
|
return [3 /*break*/, 8];
|
|
126
|
-
case 6: return [4 /*yield*/,
|
|
126
|
+
case 6: return [4 /*yield*/, internals_2.InternalAuth.currentAuthenticatedUser(undefined, customUserAgentDetails)];
|
|
127
127
|
case 7:
|
|
128
128
|
currentUser = _c.sent();
|
|
129
129
|
if (currentUser) {
|
|
@@ -144,7 +144,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
144
144
|
case 10: return [3 /*break*/, 17];
|
|
145
145
|
case 11:
|
|
146
146
|
_c.trys.push([11, 13, , 14]);
|
|
147
|
-
return [4 /*yield*/, this.
|
|
147
|
+
return [4 /*yield*/, this.InternalAuth.currentSession(customUserAgentDetails)];
|
|
148
148
|
case 12:
|
|
149
149
|
session = _c.sent();
|
|
150
150
|
headers = {
|
|
@@ -235,7 +235,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
235
235
|
_d = [{}];
|
|
236
236
|
_e = !customGraphqlEndpoint;
|
|
237
237
|
if (!_e) return [3 /*break*/, 2];
|
|
238
|
-
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders)];
|
|
238
|
+
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders, customUserAgentDetails)];
|
|
239
239
|
case 1:
|
|
240
240
|
_e = (_l.sent());
|
|
241
241
|
_l.label = 2;
|
|
@@ -244,7 +244,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
244
244
|
_g = customGraphqlEndpoint;
|
|
245
245
|
if (!_g) return [3 /*break*/, 6];
|
|
246
246
|
if (!customEndpointRegion) return [3 /*break*/, 4];
|
|
247
|
-
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders)];
|
|
247
|
+
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders, customUserAgentDetails)];
|
|
248
248
|
case 3:
|
|
249
249
|
_h = _l.sent();
|
|
250
250
|
return [3 /*break*/, 5];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalGraphQLAPI.js","sourceRoot":"","sources":["../../src/internals/InternalGraphQLAPI.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,mCAOiB;AAEjB,0C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CAAC;YAE9C,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG;YACT,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;YAC7C,OAAO,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IACF,8BAAC;AAAD,CAAC,AA7ZD,IA6ZC;AA7ZY,0DAAuB;AA+ZvB,QAAA,kBAAkB,GAAG,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;AACpE,cAAO,CAAC,QAAQ,CAAC,0BAAkB,CAAC,CAAC"}
|
package/lib/internals/index.d.ts
CHANGED
package/lib/internals/index.js
CHANGED
|
@@ -5,4 +5,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
var InternalGraphQLAPI_1 = require("./InternalGraphQLAPI");
|
|
6
6
|
exports.InternalGraphQLAPI = InternalGraphQLAPI_1.InternalGraphQLAPI;
|
|
7
7
|
exports.InternalGraphQLAPIClass = InternalGraphQLAPI_1.InternalGraphQLAPIClass;
|
|
8
|
+
var v6_1 = require("./v6");
|
|
9
|
+
exports.graphql = v6_1.graphql;
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internals/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,2DAG8B;AAF7B,kDAAA,kBAAkB,CAAA;AAClB,uDAAA,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internals/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,2DAG8B;AAF7B,kDAAA,kBAAkB,CAAA;AAClB,uDAAA,uBAAuB,CAAA;AAGxB,2BAA+B;AAAtB,uBAAA,OAAO,CAAA"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { GraphQLOptionsV6, GraphQLResponseV6 } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Invokes graphql operations against a graphql service, providing correct input and
|
|
4
|
+
* output types if Amplify-generated graphql from a recent version of the CLI/codegen
|
|
5
|
+
* are used *or* correct typing is provided via the type argument.
|
|
6
|
+
*
|
|
7
|
+
* Amplify-generated "branded" graphql queries will look similar to this:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* //
|
|
11
|
+
* // |-- branding
|
|
12
|
+
* // v
|
|
13
|
+
* export const getModel = `...` as GeneratedQuery<
|
|
14
|
+
* GetModelQueryVariables,
|
|
15
|
+
* GetModelQuery
|
|
16
|
+
* >;
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* If this branding is not in your generated graphql, update to a newer version of
|
|
20
|
+
* CLI/codegen and regenerate your graphql using `amplify codegen`.
|
|
21
|
+
*
|
|
22
|
+
* ## Using Amplify-generated graphql
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import * as queries from './graphql/queries';
|
|
26
|
+
*
|
|
27
|
+
* //
|
|
28
|
+
* // |-- correctly typed graphql response containing a Widget
|
|
29
|
+
* // v
|
|
30
|
+
* const queryResult = await graphql({
|
|
31
|
+
* query: queries.getWidget,
|
|
32
|
+
* variables: {
|
|
33
|
+
* id: "abc", // <-- type hinted/enforced
|
|
34
|
+
* },
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* //
|
|
38
|
+
* // |-- a correctly typed Widget
|
|
39
|
+
* // v
|
|
40
|
+
* const fetchedWidget = queryResult.data?.getWidget!;
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* ## Custom input + result types
|
|
44
|
+
*
|
|
45
|
+
* To provide input types (`variables`) and result types:
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* type GetById_NameOnly = {
|
|
49
|
+
* variables: {
|
|
50
|
+
* id: string
|
|
51
|
+
* },
|
|
52
|
+
* result: Promise<{
|
|
53
|
+
* data: { getWidget: { name: string } }
|
|
54
|
+
* }>
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* //
|
|
58
|
+
* // |-- type is GetById_NameOnly["result"]
|
|
59
|
+
* // v
|
|
60
|
+
* const result = graphql<GetById_NameOnly>({
|
|
61
|
+
* query: "...",
|
|
62
|
+
* variables: { id: "abc" } // <-- type of GetById_NameOnly["variables"]
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* ## Custom result type only
|
|
67
|
+
*
|
|
68
|
+
* To specify result types only, use a type that is *not* in the `{variables, result}` shape:
|
|
69
|
+
*
|
|
70
|
+
* ```ts
|
|
71
|
+
* type MyResultType = Promise<{
|
|
72
|
+
* data: {
|
|
73
|
+
* getWidget: { name: string }
|
|
74
|
+
* }
|
|
75
|
+
* }>
|
|
76
|
+
*
|
|
77
|
+
* //
|
|
78
|
+
* // |-- type is MyResultType
|
|
79
|
+
* // v
|
|
80
|
+
* const result = graphql<MyResultType>({query: "..."});
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @param options
|
|
84
|
+
* @param additionalHeaders
|
|
85
|
+
*/
|
|
86
|
+
export declare function graphql<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string>(options: GraphQLOptionsV6<FALLBACK_TYPES, TYPED_GQL_STRING>, additionalHeaders?: {
|
|
87
|
+
[key: string]: string;
|
|
88
|
+
}): GraphQLResponseV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
|
|
89
|
+
export { GraphQLOptionsV6, GraphQLResponseV6 };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
var GraphQLAPI_1 = require("../GraphQLAPI");
|
|
6
|
+
/**
|
|
7
|
+
* Invokes graphql operations against a graphql service, providing correct input and
|
|
8
|
+
* output types if Amplify-generated graphql from a recent version of the CLI/codegen
|
|
9
|
+
* are used *or* correct typing is provided via the type argument.
|
|
10
|
+
*
|
|
11
|
+
* Amplify-generated "branded" graphql queries will look similar to this:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* //
|
|
15
|
+
* // |-- branding
|
|
16
|
+
* // v
|
|
17
|
+
* export const getModel = `...` as GeneratedQuery<
|
|
18
|
+
* GetModelQueryVariables,
|
|
19
|
+
* GetModelQuery
|
|
20
|
+
* >;
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* If this branding is not in your generated graphql, update to a newer version of
|
|
24
|
+
* CLI/codegen and regenerate your graphql using `amplify codegen`.
|
|
25
|
+
*
|
|
26
|
+
* ## Using Amplify-generated graphql
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* import * as queries from './graphql/queries';
|
|
30
|
+
*
|
|
31
|
+
* //
|
|
32
|
+
* // |-- correctly typed graphql response containing a Widget
|
|
33
|
+
* // v
|
|
34
|
+
* const queryResult = await graphql({
|
|
35
|
+
* query: queries.getWidget,
|
|
36
|
+
* variables: {
|
|
37
|
+
* id: "abc", // <-- type hinted/enforced
|
|
38
|
+
* },
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* //
|
|
42
|
+
* // |-- a correctly typed Widget
|
|
43
|
+
* // v
|
|
44
|
+
* const fetchedWidget = queryResult.data?.getWidget!;
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* ## Custom input + result types
|
|
48
|
+
*
|
|
49
|
+
* To provide input types (`variables`) and result types:
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* type GetById_NameOnly = {
|
|
53
|
+
* variables: {
|
|
54
|
+
* id: string
|
|
55
|
+
* },
|
|
56
|
+
* result: Promise<{
|
|
57
|
+
* data: { getWidget: { name: string } }
|
|
58
|
+
* }>
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* //
|
|
62
|
+
* // |-- type is GetById_NameOnly["result"]
|
|
63
|
+
* // v
|
|
64
|
+
* const result = graphql<GetById_NameOnly>({
|
|
65
|
+
* query: "...",
|
|
66
|
+
* variables: { id: "abc" } // <-- type of GetById_NameOnly["variables"]
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* ## Custom result type only
|
|
71
|
+
*
|
|
72
|
+
* To specify result types only, use a type that is *not* in the `{variables, result}` shape:
|
|
73
|
+
*
|
|
74
|
+
* ```ts
|
|
75
|
+
* type MyResultType = Promise<{
|
|
76
|
+
* data: {
|
|
77
|
+
* getWidget: { name: string }
|
|
78
|
+
* }
|
|
79
|
+
* }>
|
|
80
|
+
*
|
|
81
|
+
* //
|
|
82
|
+
* // |-- type is MyResultType
|
|
83
|
+
* // v
|
|
84
|
+
* const result = graphql<MyResultType>({query: "..."});
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @param options
|
|
88
|
+
* @param additionalHeaders
|
|
89
|
+
*/
|
|
90
|
+
function graphql(options, additionalHeaders) {
|
|
91
|
+
/**
|
|
92
|
+
* The correctness of these typings depends on correct string branding or overrides.
|
|
93
|
+
* Neither of these can actually be validated at runtime. Hence, we don't perform
|
|
94
|
+
* any validation or type-guarding here.
|
|
95
|
+
*/
|
|
96
|
+
var result = GraphQLAPI_1.GraphQLAPI.graphql(options, additionalHeaders);
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
exports.graphql = graphql;
|
|
100
|
+
//# sourceMappingURL=v6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v6.js","sourceRoot":"","sources":["../../src/internals/v6.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4CAA2C;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,SAAgB,OAAO,CAItB,OAA2D,EAC3D,iBAA6C;IAE7C;;;;OAIG;IACH,IAAM,MAAM,GAAG,uBAAU,CAAC,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC9D,OAAO,MAAa,CAAC;AACtB,CAAC;AAdD,0BAcC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import { Source, DocumentNode, GraphQLError } from 'graphql';
|
|
|
2
2
|
export { OperationTypeNode } from 'graphql';
|
|
3
3
|
import { GRAPHQL_AUTH_MODE } from '@aws-amplify/auth';
|
|
4
4
|
export { GRAPHQL_AUTH_MODE };
|
|
5
|
+
import { Observable } from 'zen-observable-ts';
|
|
6
|
+
import { AWSAppSyncRealTimeProvider } from '@aws-amplify/pubsub';
|
|
7
|
+
/**
|
|
8
|
+
* Loose/Unknown options for raw GraphQLAPICategory `graphql()`.
|
|
9
|
+
*/
|
|
5
10
|
export interface GraphQLOptions {
|
|
6
11
|
query: string | DocumentNode;
|
|
7
12
|
variables?: object;
|
|
@@ -19,6 +24,56 @@ export interface GraphQLResult<T = object> {
|
|
|
19
24
|
[key: string]: any;
|
|
20
25
|
};
|
|
21
26
|
}
|
|
27
|
+
declare const queryType: unique symbol;
|
|
28
|
+
export declare type GraphQLQuery<T> = T & {
|
|
29
|
+
readonly [queryType]: 'query';
|
|
30
|
+
};
|
|
31
|
+
export declare type GraphQLSubscription<T> = T & {
|
|
32
|
+
readonly [queryType]: 'subscription';
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The return value from a `graphql({query})` call when `query` is a subscription.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* // |-- You are here
|
|
39
|
+
* // v
|
|
40
|
+
* const subResult: GraphqlSubscriptionResult<T> = client.graphql({
|
|
41
|
+
* query: onCreateWidget
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* const sub = subResult.subscribe({
|
|
45
|
+
* //
|
|
46
|
+
* // |-- You are here
|
|
47
|
+
* // v
|
|
48
|
+
* next(message: GraphqlSubscriptionMessage<OnCreateWidgetSubscription>) {
|
|
49
|
+
* handle(message.value); // <-- type OnCreateWidgetSubscription
|
|
50
|
+
* }
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare type GraphqlSubscriptionResult<T> = Observable<GraphqlSubscriptionMessage<T>>;
|
|
55
|
+
/**
|
|
56
|
+
* The shape of messages passed to `next()` from a graphql subscription. E.g.,
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* const sub = client.graphql({
|
|
60
|
+
* query: onCreateWidget,
|
|
61
|
+
* }).subscribe({
|
|
62
|
+
* //
|
|
63
|
+
* // |-- You are here
|
|
64
|
+
* // v
|
|
65
|
+
* next(message: GraphqlSubscriptionMessage<OnCreateWidgetSubscription>) {
|
|
66
|
+
* handle(message.value); // <-- type OnCreateWidgetSubscription
|
|
67
|
+
* }
|
|
68
|
+
* })
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare type GraphqlSubscriptionMessage<T> = {
|
|
72
|
+
provider: AWSAppSyncRealTimeProvider;
|
|
73
|
+
value: {
|
|
74
|
+
data?: T;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
22
77
|
export declare enum GraphQLAuthError {
|
|
23
78
|
NO_API_KEY = "No api-key configured",
|
|
24
79
|
NO_CURRENT_USER = "No current user",
|
|
@@ -31,3 +86,117 @@ export declare enum GraphQLAuthError {
|
|
|
31
86
|
* @see: https://graphql.org/graphql-js/language/#parse
|
|
32
87
|
*/
|
|
33
88
|
export declare type GraphQLOperation = Source | string;
|
|
89
|
+
/**
|
|
90
|
+
* API V6 `graphql({options})` type that can leverage branded graphql `query`
|
|
91
|
+
* objects and fallback types.
|
|
92
|
+
*/
|
|
93
|
+
export interface GraphQLOptionsV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string> {
|
|
94
|
+
query: TYPED_GQL_STRING | DocumentNode;
|
|
95
|
+
variables?: GraphQLVariablesV6<FALLBACK_TYPES, TYPED_GQL_STRING>;
|
|
96
|
+
authMode?: keyof typeof GRAPHQL_AUTH_MODE;
|
|
97
|
+
authToken?: string;
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated This property should not be used
|
|
100
|
+
*/
|
|
101
|
+
userAgentSuffix?: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Result type for `graphql()` operations that don't include any specific
|
|
105
|
+
* type information. The result could be either a `Promise` or `Subscription`.
|
|
106
|
+
*
|
|
107
|
+
* Invoking code should either cast the result or use `?` and `!` operators to
|
|
108
|
+
* navigate the result objects.
|
|
109
|
+
*/
|
|
110
|
+
export declare type UnknownGraphQLResponse = Promise<GraphQLResult<any>> | GraphqlSubscriptionResult<any>;
|
|
111
|
+
/**
|
|
112
|
+
* The expected type for `variables` in a V6 `graphql()` operation with
|
|
113
|
+
* respect to the given `FALLBACK_TYPES` and `TYPED_GQL_STRING`.
|
|
114
|
+
*/
|
|
115
|
+
export declare type GraphQLVariablesV6<FALLBACK_TYPES = unknown, TYPED_GQL_STRING extends string = string> = TYPED_GQL_STRING extends GeneratedQuery<infer IN, any> ? IN : TYPED_GQL_STRING extends GeneratedMutation<infer IN, any> ? IN : TYPED_GQL_STRING extends GeneratedSubscription<infer IN, any> ? IN : FALLBACK_TYPES extends GraphQLOperationType<infer IN, any> ? IN : any;
|
|
116
|
+
/**
|
|
117
|
+
* The expected return type with respect to the given `FALLBACK_TYPE`
|
|
118
|
+
* and `TYPED_GQL_STRING`.
|
|
119
|
+
*/
|
|
120
|
+
export declare type GraphQLResponseV6<FALLBACK_TYPE = unknown, TYPED_GQL_STRING extends string = string> = TYPED_GQL_STRING extends GeneratedQuery<infer IN, infer QUERY_OUT> ? Promise<GraphQLResult<QUERY_OUT>> : TYPED_GQL_STRING extends GeneratedMutation<infer IN, infer MUTATION_OUT> ? Promise<GraphQLResult<MUTATION_OUT>> : TYPED_GQL_STRING extends GeneratedSubscription<infer IN, infer SUB_OUT> ? GraphqlSubscriptionResult<SUB_OUT> : FALLBACK_TYPE extends GraphQLQuery<infer T> ? Promise<GraphQLResult<FALLBACK_TYPE>> : FALLBACK_TYPE extends GraphQLSubscription<infer T> ? GraphqlSubscriptionResult<FALLBACK_TYPE> : FALLBACK_TYPE extends GraphQLOperationType<infer IN, infer CUSTOM_OUT> ? CUSTOM_OUT : UnknownGraphQLResponse;
|
|
121
|
+
/**
|
|
122
|
+
* The shape customers can use to provide `T` to `graphql<T>()` to specify both
|
|
123
|
+
* `IN` and `OUT` types (the type of `variables` and the return type, respectively).
|
|
124
|
+
*
|
|
125
|
+
* I.E.,
|
|
126
|
+
*
|
|
127
|
+
* ```ts
|
|
128
|
+
* type MyVariablesType = { ... };
|
|
129
|
+
* type MyResultType = { ... };
|
|
130
|
+
* type MyOperationType = { variables: MyVariablesType, result: MyResultType };
|
|
131
|
+
*
|
|
132
|
+
* const result: MyResultType = graphql<MyOperationType>("graphql string", {
|
|
133
|
+
* variables: {
|
|
134
|
+
* // MyVariablesType
|
|
135
|
+
* }
|
|
136
|
+
* })
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export declare type GraphQLOperationType<IN extends {}, OUT extends {}> = {
|
|
140
|
+
variables: IN;
|
|
141
|
+
result: OUT;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Nominal type for branding generated graphql query operation strings with
|
|
145
|
+
* input and output types.
|
|
146
|
+
*
|
|
147
|
+
* E.g.,
|
|
148
|
+
*
|
|
149
|
+
* ```ts
|
|
150
|
+
* export const getWidget = `...` as GeneratedQuery<
|
|
151
|
+
* GetWidgetQueryVariables,
|
|
152
|
+
* GetWidgetQuery
|
|
153
|
+
* >;
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* This allows `graphql()` to extract `InputType` and `OutputType` to correctly
|
|
157
|
+
* assign types to the `variables` and result objects.
|
|
158
|
+
*/
|
|
159
|
+
export declare type GeneratedQuery<InputType, OutputType> = string & {
|
|
160
|
+
__generatedQueryInput: InputType;
|
|
161
|
+
__generatedQueryOutput: OutputType;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Nominal type for branding generated graphql mutation operation strings with
|
|
165
|
+
* input and output types.
|
|
166
|
+
*
|
|
167
|
+
* E.g.,
|
|
168
|
+
*
|
|
169
|
+
* ```ts
|
|
170
|
+
* export const createWidget = `...` as GeneratedQuery<
|
|
171
|
+
* CreateWidgetMutationVariables,
|
|
172
|
+
* CreateWidgetMutation
|
|
173
|
+
* >;
|
|
174
|
+
* ```
|
|
175
|
+
*
|
|
176
|
+
* This allows `graphql()` to extract `InputType` and `OutputType` to correctly
|
|
177
|
+
* assign types to the `variables` and result objects.
|
|
178
|
+
*/
|
|
179
|
+
export declare type GeneratedMutation<InputType, OutputType> = string & {
|
|
180
|
+
__generatedMutationInput: InputType;
|
|
181
|
+
__generatedMutationOutput: OutputType;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Nominal type for branding generated graphql mutation operation strings with
|
|
185
|
+
* input and output types.
|
|
186
|
+
*
|
|
187
|
+
* E.g.,
|
|
188
|
+
*
|
|
189
|
+
* ```ts
|
|
190
|
+
* export const createWidget = `...` as GeneratedMutation<
|
|
191
|
+
* CreateWidgetMutationVariables,
|
|
192
|
+
* CreateWidgetMutation
|
|
193
|
+
* >;
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* This allows `graphql()` to extract `InputType` and `OutputType` to correctly
|
|
197
|
+
* assign types to the `variables` and result objects.
|
|
198
|
+
*/
|
|
199
|
+
export declare type GeneratedSubscription<InputType, OutputType> = string & {
|
|
200
|
+
__generatedSubscriptionInput: InputType;
|
|
201
|
+
__generatedSubscriptionOutput: OutputType;
|
|
202
|
+
};
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;AAIA,0CAAsD;AAC7C,4BADA,wBAAiB,CACA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;AAIA,0CAAsD;AAC7C,4BADA,wBAAiB,CACA;AA+E1B,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC3B,wDAAoC,CAAA;IACpC,uDAAmC,CAAA;IACnC,qDAAiC,CAAA;IACjC,yDAAqC,CAAA;IACrC,6DAAyC,CAAA;AAC1C,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B"}
|
|
@@ -16,7 +16,7 @@ export declare class InternalGraphQLAPIClass {
|
|
|
16
16
|
*/
|
|
17
17
|
private _options;
|
|
18
18
|
private _api;
|
|
19
|
-
|
|
19
|
+
InternalAuth: import("@aws-amplify/auth/lib-esm/internals/InternalAuth").InternalAuthClass;
|
|
20
20
|
Cache: import("@aws-amplify/cache/lib-esm/types").ICache;
|
|
21
21
|
Credentials: import("@aws-amplify/core").CredentialsClass;
|
|
22
22
|
/**
|
|
@@ -4,7 +4,7 @@ import { __assign, __awaiter, __generator, __read, __rest } from "tslib";
|
|
|
4
4
|
import { print, parse, GraphQLError, } from 'graphql';
|
|
5
5
|
import { Amplify, ConsoleLogger as Logger, Credentials, getAmplifyUserAgent, INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER, } from '@aws-amplify/core';
|
|
6
6
|
import { InternalPubSub } from '@aws-amplify/pubsub/internals';
|
|
7
|
-
import {
|
|
7
|
+
import { InternalAuth } from '@aws-amplify/auth/internals';
|
|
8
8
|
import { Cache } from '@aws-amplify/cache';
|
|
9
9
|
import { GraphQLAuthError, } from '../types';
|
|
10
10
|
import { RestClient } from '@aws-amplify/api-rest';
|
|
@@ -28,7 +28,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
28
28
|
*/
|
|
29
29
|
function InternalGraphQLAPIClass(options) {
|
|
30
30
|
this._api = null;
|
|
31
|
-
this.
|
|
31
|
+
this.InternalAuth = InternalAuth;
|
|
32
32
|
this.Cache = Cache;
|
|
33
33
|
this.Credentials = Credentials;
|
|
34
34
|
this._options = options;
|
|
@@ -77,7 +77,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
77
77
|
return Promise.reject('API not configured');
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
InternalGraphQLAPIClass.prototype._headerBasedAuth = function (defaultAuthenticationType, additionalHeaders) {
|
|
80
|
+
InternalGraphQLAPIClass.prototype._headerBasedAuth = function (defaultAuthenticationType, additionalHeaders, customUserAgentDetails) {
|
|
81
81
|
if (additionalHeaders === void 0) { additionalHeaders = {}; }
|
|
82
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
83
|
var _a, aws_appsync_authenticationType, apiKey, authenticationType, headers, _b, credentialsOK, token, federatedInfo, currentUser, e_1, session, e_2;
|
|
@@ -121,7 +121,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
121
121
|
if (!federatedInfo) return [3 /*break*/, 6];
|
|
122
122
|
token = federatedInfo.token;
|
|
123
123
|
return [3 /*break*/, 8];
|
|
124
|
-
case 6: return [4 /*yield*/,
|
|
124
|
+
case 6: return [4 /*yield*/, InternalAuth.currentAuthenticatedUser(undefined, customUserAgentDetails)];
|
|
125
125
|
case 7:
|
|
126
126
|
currentUser = _c.sent();
|
|
127
127
|
if (currentUser) {
|
|
@@ -142,7 +142,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
142
142
|
case 10: return [3 /*break*/, 17];
|
|
143
143
|
case 11:
|
|
144
144
|
_c.trys.push([11, 13, , 14]);
|
|
145
|
-
return [4 /*yield*/, this.
|
|
145
|
+
return [4 /*yield*/, this.InternalAuth.currentSession(customUserAgentDetails)];
|
|
146
146
|
case 12:
|
|
147
147
|
session = _c.sent();
|
|
148
148
|
headers = {
|
|
@@ -233,7 +233,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
233
233
|
_d = [{}];
|
|
234
234
|
_e = !customGraphqlEndpoint;
|
|
235
235
|
if (!_e) return [3 /*break*/, 2];
|
|
236
|
-
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders)];
|
|
236
|
+
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders, customUserAgentDetails)];
|
|
237
237
|
case 1:
|
|
238
238
|
_e = (_l.sent());
|
|
239
239
|
_l.label = 2;
|
|
@@ -242,7 +242,7 @@ var InternalGraphQLAPIClass = /** @class */ (function () {
|
|
|
242
242
|
_g = customGraphqlEndpoint;
|
|
243
243
|
if (!_g) return [3 /*break*/, 6];
|
|
244
244
|
if (!customEndpointRegion) return [3 /*break*/, 4];
|
|
245
|
-
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders)];
|
|
245
|
+
return [4 /*yield*/, this._headerBasedAuth(authMode, additionalHeaders, customUserAgentDetails)];
|
|
246
246
|
case 3:
|
|
247
247
|
_h = _l.sent();
|
|
248
248
|
return [3 /*break*/, 5];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalGraphQLAPI.js","sourceRoot":"","sources":["../../src/internals/InternalGraphQLAPI.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAGN,KAAK,EACL,KAAK,EACL,YAAY,GAEZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EACN,OAAO,EACP,aAAa,IAAI,MAAM,EACvB,WAAW,EAEX,mBAAmB,EACnB,6CAA6C,GAC7C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"InternalGraphQLAPI.js","sourceRoot":"","sources":["../../src/internals/InternalGraphQLAPI.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAGN,KAAK,EACL,KAAK,E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AAC;YAC/B,IAAM,IAAI,GAAG,KAAI,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjD,MAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;YAE9C,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG;YACT,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;YAC7C,OAAO,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IACF,8BAAC;AAAD,CAAC,AA7ZD,IA6ZC;;AAED,MAAM,CAAC,IAAM,kBAAkB,GAAG,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC;AACpE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internals/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EACN,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internals/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EACN,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC"}
|