@aws-amplify/graphql-model-transformer 0.9.3-beta.0 → 0.9.5-apiext5.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/CHANGELOG.md +26 -3
- package/lib/definitions.d.ts +1 -0
- package/lib/definitions.d.ts.map +1 -1
- package/lib/definitions.js +2 -1
- package/lib/definitions.js.map +1 -1
- package/lib/graphql-model-transformer.d.ts +2 -1
- package/lib/graphql-model-transformer.d.ts.map +1 -1
- package/lib/graphql-model-transformer.js +137 -85
- package/lib/graphql-model-transformer.js.map +1 -1
- package/lib/graphql-types/common.d.ts +7 -3
- package/lib/graphql-types/common.d.ts.map +1 -1
- package/lib/graphql-types/common.js +86 -22
- package/lib/graphql-types/common.js.map +1 -1
- package/lib/graphql-types/mutation.js +14 -14
- package/lib/graphql-types/mutation.js.map +1 -1
- package/lib/graphql-types/query.js +6 -6
- package/lib/graphql-types/query.js.map +1 -1
- package/lib/resolvers/common.d.ts +1 -1
- package/lib/resolvers/common.d.ts.map +1 -1
- package/lib/resolvers/common.js +20 -21
- package/lib/resolvers/common.js.map +1 -1
- package/lib/resolvers/mutation.js +128 -128
- package/lib/resolvers/mutation.js.map +1 -1
- package/lib/resolvers/query.js +69 -69
- package/lib/resolvers/query.js.map +1 -1
- package/lib/resolvers/subscriptions.js +4 -4
- package/lib/resolvers/subscriptions.js.map +1 -1
- package/package.json +10 -7
- package/src/__tests__/__snapshots__/model-transformer-override.test.ts.snap +3009 -0
- package/src/__tests__/__snapshots__/model-transformer.test.ts.snap +3 -3
- package/src/__tests__/model-transformer-override.test.ts +41 -0
- package/src/__tests__/model-transformer.test.ts +132 -37
- package/src/__tests__/overrides/build/override.js +8 -0
- package/src/definitions.ts +2 -0
- package/src/graphql-model-transformer.ts +81 -9
- package/src/graphql-types/common.ts +98 -2
- package/src/graphql-types/mutation.ts +1 -1
- package/src/graphql-types/query.ts +1 -1
- package/src/resolvers/common.ts +1 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/wrappers/object-definition-wrapper.d.ts +0 -77
- package/lib/wrappers/object-definition-wrapper.d.ts.map +0 -1
- package/lib/wrappers/object-definition-wrapper.js +0 -354
- package/lib/wrappers/object-definition-wrapper.js.map +0 -1
- package/src/wrappers/object-definition-wrapper.ts +0 -447
package/lib/resolvers/query.js
CHANGED
|
@@ -3,105 +3,105 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateSyncRequestTemplate = exports.generateListRequestTemplate = exports.generateGetResponseTemplate = exports.generateGetRequestTemplate = void 0;
|
|
4
4
|
const graphql_mapping_template_1 = require("graphql-mapping-template");
|
|
5
5
|
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
|
6
|
-
const authFilter = graphql_mapping_template_1.ref('ctx.stash.authFilter');
|
|
6
|
+
const authFilter = (0, graphql_mapping_template_1.ref)('ctx.stash.authFilter');
|
|
7
7
|
const generateGetRequestTemplate = () => {
|
|
8
8
|
const statements = [
|
|
9
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('GetRequest'), graphql_mapping_template_1.obj({ version: graphql_mapping_template_1.str('2018-05-29'), operation: graphql_mapping_template_1.str('Query') })),
|
|
10
|
-
graphql_mapping_template_1.ifElse(graphql_mapping_template_1.ref('ctx.stash.metadata.modelObjectKey'), graphql_mapping_template_1.compoundExpression([
|
|
11
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('expression'), graphql_mapping_template_1.str('')),
|
|
12
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('expressionNames'), graphql_mapping_template_1.obj({})),
|
|
13
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('expressionValues'), graphql_mapping_template_1.obj({})),
|
|
14
|
-
graphql_mapping_template_1.forEach(graphql_mapping_template_1.ref('item'), graphql_mapping_template_1.ref('ctx.stash.metadata.modelObjectKey.entrySet()'), [
|
|
15
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('expression'), graphql_mapping_template_1.str('$expression#keyCount$velocityCount = :valueCount$velocityCount AND ')),
|
|
16
|
-
graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('expressionNames.put'), graphql_mapping_template_1.str('#keyCount$velocityCount'), graphql_mapping_template_1.ref('item.key'))),
|
|
17
|
-
graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('expressionValues.put'), graphql_mapping_template_1.str(':valueCount$velocityCount'), graphql_mapping_template_1.ref('item.value'))),
|
|
9
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('GetRequest'), (0, graphql_mapping_template_1.obj)({ version: (0, graphql_mapping_template_1.str)('2018-05-29'), operation: (0, graphql_mapping_template_1.str)('Query') })),
|
|
10
|
+
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.ref)('ctx.stash.metadata.modelObjectKey'), (0, graphql_mapping_template_1.compoundExpression)([
|
|
11
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('expression'), (0, graphql_mapping_template_1.str)('')),
|
|
12
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('expressionNames'), (0, graphql_mapping_template_1.obj)({})),
|
|
13
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('expressionValues'), (0, graphql_mapping_template_1.obj)({})),
|
|
14
|
+
(0, graphql_mapping_template_1.forEach)((0, graphql_mapping_template_1.ref)('item'), (0, graphql_mapping_template_1.ref)('ctx.stash.metadata.modelObjectKey.entrySet()'), [
|
|
15
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('expression'), (0, graphql_mapping_template_1.str)('$expression#keyCount$velocityCount = :valueCount$velocityCount AND ')),
|
|
16
|
+
(0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('expressionNames.put'), (0, graphql_mapping_template_1.str)('#keyCount$velocityCount'), (0, graphql_mapping_template_1.ref)('item.key'))),
|
|
17
|
+
(0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('expressionValues.put'), (0, graphql_mapping_template_1.str)(':valueCount$velocityCount'), (0, graphql_mapping_template_1.ref)('item.value'))),
|
|
18
18
|
]),
|
|
19
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('expression'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('expression.replaceAll'), graphql_mapping_template_1.str('AND $'), graphql_mapping_template_1.str(''))),
|
|
20
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('query'), graphql_mapping_template_1.obj({ expression: graphql_mapping_template_1.ref('expression'), expressionNames: graphql_mapping_template_1.ref('expressionNames'), expressionValues: graphql_mapping_template_1.ref('expressionValues') })),
|
|
21
|
-
]), graphql_mapping_template_1.set(graphql_mapping_template_1.ref('query'), graphql_mapping_template_1.obj({
|
|
22
|
-
expression: graphql_mapping_template_1.str('id = :id'),
|
|
23
|
-
expressionValues: graphql_mapping_template_1.obj({
|
|
24
|
-
':id': graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.parseJson'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.dynamodb.toDynamoDBJson'), graphql_mapping_template_1.ref('ctx.args.id'))),
|
|
19
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('expression'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('expression.replaceAll'), (0, graphql_mapping_template_1.str)('AND $'), (0, graphql_mapping_template_1.str)(''))),
|
|
20
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('query'), (0, graphql_mapping_template_1.obj)({ expression: (0, graphql_mapping_template_1.ref)('expression'), expressionNames: (0, graphql_mapping_template_1.ref)('expressionNames'), expressionValues: (0, graphql_mapping_template_1.ref)('expressionValues') })),
|
|
21
|
+
]), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('query'), (0, graphql_mapping_template_1.obj)({
|
|
22
|
+
expression: (0, graphql_mapping_template_1.str)('id = :id'),
|
|
23
|
+
expressionValues: (0, graphql_mapping_template_1.obj)({
|
|
24
|
+
':id': (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.parseJson'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.dynamodb.toDynamoDBJson'), (0, graphql_mapping_template_1.ref)('ctx.args.id'))),
|
|
25
25
|
}),
|
|
26
26
|
}))),
|
|
27
|
-
graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('GetRequest.put'), graphql_mapping_template_1.str('query'), graphql_mapping_template_1.ref('query'))),
|
|
28
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(authFilter)), graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('GetRequest.put'), graphql_mapping_template_1.str('filter'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.parseJson'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.transform.toDynamoDBFilterExpression'), authFilter))))),
|
|
29
|
-
graphql_mapping_template_1.toJson(graphql_mapping_template_1.ref('GetRequest')),
|
|
27
|
+
(0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('GetRequest.put'), (0, graphql_mapping_template_1.str)('query'), (0, graphql_mapping_template_1.ref)('query'))),
|
|
28
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)(authFilter)), (0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('GetRequest.put'), (0, graphql_mapping_template_1.str)('filter'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.parseJson'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.transform.toDynamoDBFilterExpression'), authFilter))))),
|
|
29
|
+
(0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.ref)('GetRequest')),
|
|
30
30
|
];
|
|
31
|
-
return graphql_mapping_template_1.printBlock('Get Request template')(graphql_mapping_template_1.compoundExpression(statements));
|
|
31
|
+
return (0, graphql_mapping_template_1.printBlock)('Get Request template')((0, graphql_mapping_template_1.compoundExpression)(statements));
|
|
32
32
|
};
|
|
33
33
|
exports.generateGetRequestTemplate = generateGetRequestTemplate;
|
|
34
34
|
const generateGetResponseTemplate = (isSyncEnabled) => {
|
|
35
35
|
const statements = new Array();
|
|
36
36
|
if (isSyncEnabled) {
|
|
37
|
-
statements.push(graphql_mapping_template_1.iff(graphql_mapping_template_1.ref('ctx.error'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.error'), graphql_mapping_template_1.ref('ctx.error.message'), graphql_mapping_template_1.ref('ctx.error.type'), graphql_mapping_template_1.ref('ctx.result'))));
|
|
37
|
+
statements.push((0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.ref)('ctx.error'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.error'), (0, graphql_mapping_template_1.ref)('ctx.error.message'), (0, graphql_mapping_template_1.ref)('ctx.error.type'), (0, graphql_mapping_template_1.ref)('ctx.result'))));
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
statements.push(graphql_mapping_template_1.iff(graphql_mapping_template_1.ref('ctx.error'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.error'), graphql_mapping_template_1.ref('ctx.error.message'), graphql_mapping_template_1.ref('ctx.error.type'))));
|
|
40
|
+
statements.push((0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.ref)('ctx.error'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.error'), (0, graphql_mapping_template_1.ref)('ctx.error.message'), (0, graphql_mapping_template_1.ref)('ctx.error.type'))));
|
|
41
41
|
}
|
|
42
|
-
statements.push(graphql_mapping_template_1.ifElse(graphql_mapping_template_1.and([graphql_mapping_template_1.not(graphql_mapping_template_1.ref('ctx.result.items.isEmpty()')), graphql_mapping_template_1.equals(graphql_mapping_template_1.ref('ctx.result.scannedCount'), graphql_mapping_template_1.int(1))]), graphql_mapping_template_1.toJson(graphql_mapping_template_1.ref('ctx.result.items[0]')), graphql_mapping_template_1.compoundExpression([
|
|
43
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.and([graphql_mapping_template_1.ref('ctx.result.items.isEmpty()'), graphql_mapping_template_1.equals(graphql_mapping_template_1.ref('ctx.result.scannedCount'), graphql_mapping_template_1.int(1))]), graphql_mapping_template_1.ref('util.unauthorized()')),
|
|
44
|
-
graphql_mapping_template_1.toJson(graphql_mapping_template_1.nul()),
|
|
42
|
+
statements.push((0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.and)([(0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.ref)('ctx.result.items.isEmpty()')), (0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('ctx.result.scannedCount'), (0, graphql_mapping_template_1.int)(1))]), (0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.ref)('ctx.result.items[0]')), (0, graphql_mapping_template_1.compoundExpression)([
|
|
43
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.and)([(0, graphql_mapping_template_1.ref)('ctx.result.items.isEmpty()'), (0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('ctx.result.scannedCount'), (0, graphql_mapping_template_1.int)(1))]), (0, graphql_mapping_template_1.ref)('util.unauthorized()')),
|
|
44
|
+
(0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.nul)()),
|
|
45
45
|
])));
|
|
46
|
-
return graphql_mapping_template_1.printBlock('Get Response template')(graphql_mapping_template_1.compoundExpression(statements));
|
|
46
|
+
return (0, graphql_mapping_template_1.printBlock)('Get Response template')((0, graphql_mapping_template_1.compoundExpression)(statements));
|
|
47
47
|
};
|
|
48
48
|
exports.generateGetResponseTemplate = generateGetResponseTemplate;
|
|
49
49
|
const generateListRequestTemplate = () => {
|
|
50
50
|
const requestVariable = 'ListRequest';
|
|
51
51
|
const modelQueryObj = 'ctx.stash.modelQueryExpression';
|
|
52
52
|
const indexNameVariable = 'ctx.stash.metadata.index';
|
|
53
|
-
const expression = graphql_mapping_template_1.compoundExpression([
|
|
54
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('limit'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref(`util.defaultIfNull`), graphql_mapping_template_1.ref('context.args.limit'), graphql_mapping_template_1.int(100))),
|
|
55
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref(requestVariable), graphql_mapping_template_1.obj({
|
|
56
|
-
version: graphql_mapping_template_1.str('2018-05-29'),
|
|
57
|
-
limit: graphql_mapping_template_1.ref('limit'),
|
|
53
|
+
const expression = (0, graphql_mapping_template_1.compoundExpression)([
|
|
54
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('limit'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)(`util.defaultIfNull`), (0, graphql_mapping_template_1.ref)('context.args.limit'), (0, graphql_mapping_template_1.int)(100))),
|
|
55
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(requestVariable), (0, graphql_mapping_template_1.obj)({
|
|
56
|
+
version: (0, graphql_mapping_template_1.str)('2018-05-29'),
|
|
57
|
+
limit: (0, graphql_mapping_template_1.ref)('limit'),
|
|
58
58
|
})),
|
|
59
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.ref('context.args.nextToken'), graphql_mapping_template_1.set(graphql_mapping_template_1.ref(`${requestVariable}.nextToken`), graphql_mapping_template_1.ref('context.args.nextToken'))),
|
|
60
|
-
graphql_mapping_template_1.ifElse(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(authFilter)), graphql_mapping_template_1.compoundExpression([
|
|
61
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('filter'), authFilter),
|
|
62
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(graphql_mapping_template_1.ref('ctx.args.filter'))), graphql_mapping_template_1.set(graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.obj({ and: graphql_mapping_template_1.list([graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.ref('ctx.args.filter')]) }))),
|
|
63
|
-
]), graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(graphql_mapping_template_1.ref('ctx.args.filter'))), graphql_mapping_template_1.set(graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.ref('ctx.args.filter')))),
|
|
64
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(graphql_mapping_template_1.ref('filter'))), graphql_mapping_template_1.compoundExpression([
|
|
65
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref(`filterExpression`), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.parseJson'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.transform.toDynamoDBFilterExpression'), graphql_mapping_template_1.ref('filter')))),
|
|
66
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.isNullOrBlank'), graphql_mapping_template_1.ref('filterExpression.expression'))), graphql_mapping_template_1.compoundExpression([
|
|
67
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.equals(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('filterEpression.expressionValues.size')), graphql_mapping_template_1.int(0)), graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('filterEpression.remove'), graphql_mapping_template_1.str('expressionValues')))),
|
|
68
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref(`${requestVariable}.filter`), graphql_mapping_template_1.ref(`filterExpression`)),
|
|
59
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.ref)('context.args.nextToken'), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`${requestVariable}.nextToken`), (0, graphql_mapping_template_1.ref)('context.args.nextToken'))),
|
|
60
|
+
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)(authFilter)), (0, graphql_mapping_template_1.compoundExpression)([
|
|
61
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), authFilter),
|
|
62
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('ctx.args.filter'))), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.obj)({ and: (0, graphql_mapping_template_1.list)([(0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('ctx.args.filter')]) }))),
|
|
63
|
+
]), (0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('ctx.args.filter'))), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('ctx.args.filter')))),
|
|
64
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('filter'))), (0, graphql_mapping_template_1.compoundExpression)([
|
|
65
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`filterExpression`), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.parseJson'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.transform.toDynamoDBFilterExpression'), (0, graphql_mapping_template_1.ref)('filter')))),
|
|
66
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNullOrBlank'), (0, graphql_mapping_template_1.ref)('filterExpression.expression'))), (0, graphql_mapping_template_1.compoundExpression)([
|
|
67
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('filterEpression.expressionValues.size')), (0, graphql_mapping_template_1.int)(0)), (0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('filterEpression.remove'), (0, graphql_mapping_template_1.str)('expressionValues')))),
|
|
68
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`${requestVariable}.filter`), (0, graphql_mapping_template_1.ref)(`filterExpression`)),
|
|
69
69
|
])),
|
|
70
70
|
])),
|
|
71
|
-
graphql_mapping_template_1.ifElse(graphql_mapping_template_1.and([
|
|
72
|
-
graphql_mapping_template_1.not(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.isNull'), graphql_mapping_template_1.ref(modelQueryObj))),
|
|
73
|
-
graphql_mapping_template_1.not(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.isNullOrEmpty'), graphql_mapping_template_1.ref(`${modelQueryObj}.expression`))),
|
|
74
|
-
]), graphql_mapping_template_1.compoundExpression([
|
|
75
|
-
graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref(`${requestVariable}.put`), graphql_mapping_template_1.str('operation'), graphql_mapping_template_1.str('Query'))),
|
|
76
|
-
graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref(`${requestVariable}.put`), graphql_mapping_template_1.str('query'), graphql_mapping_template_1.ref(modelQueryObj))),
|
|
77
|
-
graphql_mapping_template_1.ifElse(graphql_mapping_template_1.and([graphql_mapping_template_1.not(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.isNull'), graphql_mapping_template_1.ref('ctx.args.sortDirection'))), graphql_mapping_template_1.equals(graphql_mapping_template_1.ref('ctx.args.sortDirection'), graphql_mapping_template_1.str('DESC'))]), graphql_mapping_template_1.set(graphql_mapping_template_1.ref(`${requestVariable}.scanIndexForward`), graphql_mapping_template_1.bool(false)), graphql_mapping_template_1.set(graphql_mapping_template_1.ref(`${requestVariable}.scanIndexForward`), graphql_mapping_template_1.bool(true))),
|
|
78
|
-
]), graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref(`${requestVariable}.put`), graphql_mapping_template_1.str('operation'), graphql_mapping_template_1.str('Scan')))),
|
|
79
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.isNull'), graphql_mapping_template_1.ref(indexNameVariable))), graphql_mapping_template_1.set(graphql_mapping_template_1.ref(`${requestVariable}.IndexName`), graphql_mapping_template_1.ref(indexNameVariable))),
|
|
80
|
-
graphql_mapping_template_1.toJson(graphql_mapping_template_1.ref(requestVariable)),
|
|
71
|
+
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.and)([
|
|
72
|
+
(0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNull'), (0, graphql_mapping_template_1.ref)(modelQueryObj))),
|
|
73
|
+
(0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNullOrEmpty'), (0, graphql_mapping_template_1.ref)(`${modelQueryObj}.expression`))),
|
|
74
|
+
]), (0, graphql_mapping_template_1.compoundExpression)([
|
|
75
|
+
(0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)(`${requestVariable}.put`), (0, graphql_mapping_template_1.str)('operation'), (0, graphql_mapping_template_1.str)('Query'))),
|
|
76
|
+
(0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)(`${requestVariable}.put`), (0, graphql_mapping_template_1.str)('query'), (0, graphql_mapping_template_1.ref)(modelQueryObj))),
|
|
77
|
+
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.and)([(0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNull'), (0, graphql_mapping_template_1.ref)('ctx.args.sortDirection'))), (0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('ctx.args.sortDirection'), (0, graphql_mapping_template_1.str)('DESC'))]), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`${requestVariable}.scanIndexForward`), (0, graphql_mapping_template_1.bool)(false)), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`${requestVariable}.scanIndexForward`), (0, graphql_mapping_template_1.bool)(true))),
|
|
78
|
+
]), (0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)(`${requestVariable}.put`), (0, graphql_mapping_template_1.str)('operation'), (0, graphql_mapping_template_1.str)('Scan')))),
|
|
79
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNull'), (0, graphql_mapping_template_1.ref)(indexNameVariable))), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`${requestVariable}.IndexName`), (0, graphql_mapping_template_1.ref)(indexNameVariable))),
|
|
80
|
+
(0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.ref)(requestVariable)),
|
|
81
81
|
]);
|
|
82
|
-
return graphql_mapping_template_1.printBlock('List Request')(expression);
|
|
82
|
+
return (0, graphql_mapping_template_1.printBlock)('List Request')(expression);
|
|
83
83
|
};
|
|
84
84
|
exports.generateListRequestTemplate = generateListRequestTemplate;
|
|
85
85
|
const generateSyncRequestTemplate = () => {
|
|
86
|
-
return graphql_mapping_template_1.printBlock('Sync Request template')(graphql_mapping_template_1.compoundExpression([
|
|
87
|
-
graphql_mapping_template_1.ifElse(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(authFilter)), graphql_mapping_template_1.compoundExpression([
|
|
88
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('filter'), authFilter),
|
|
89
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(graphql_mapping_template_1.ref('ctx.args.filter'))), graphql_mapping_template_1.set(graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.obj({ and: graphql_mapping_template_1.list([graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.ref('ctx.args.filter')]) }))),
|
|
90
|
-
]), graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(graphql_mapping_template_1.ref('ctx.args.filter'))), graphql_mapping_template_1.set(graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.ref('ctx.args.filter')))),
|
|
91
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.isNullOrEmpty(graphql_mapping_template_1.ref('filter'))), graphql_mapping_template_1.compoundExpression([
|
|
92
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref(`filterExpression`), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.parseJson'), graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.transform.toDynamoDBFilterExpression'), graphql_mapping_template_1.ref('filter')))),
|
|
93
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.not(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('util.isNullOrBlank'), graphql_mapping_template_1.ref('filterExpression.expression'))), graphql_mapping_template_1.compoundExpression([
|
|
94
|
-
graphql_mapping_template_1.iff(graphql_mapping_template_1.equals(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('filterEpression.expressionValues.size')), graphql_mapping_template_1.int(0)), graphql_mapping_template_1.qref(graphql_mapping_template_1.methodCall(graphql_mapping_template_1.ref('filterEpression.remove'), graphql_mapping_template_1.str('expressionValues')))),
|
|
95
|
-
graphql_mapping_template_1.set(graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.ref('filterExpression')),
|
|
86
|
+
return (0, graphql_mapping_template_1.printBlock)('Sync Request template')((0, graphql_mapping_template_1.compoundExpression)([
|
|
87
|
+
(0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)(authFilter)), (0, graphql_mapping_template_1.compoundExpression)([
|
|
88
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), authFilter),
|
|
89
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('ctx.args.filter'))), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.obj)({ and: (0, graphql_mapping_template_1.list)([(0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('ctx.args.filter')]) }))),
|
|
90
|
+
]), (0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('ctx.args.filter'))), (0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('ctx.args.filter')))),
|
|
91
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.isNullOrEmpty)((0, graphql_mapping_template_1.ref)('filter'))), (0, graphql_mapping_template_1.compoundExpression)([
|
|
92
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)(`filterExpression`), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.parseJson'), (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.transform.toDynamoDBFilterExpression'), (0, graphql_mapping_template_1.ref)('filter')))),
|
|
93
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.not)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNullOrBlank'), (0, graphql_mapping_template_1.ref)('filterExpression.expression'))), (0, graphql_mapping_template_1.compoundExpression)([
|
|
94
|
+
(0, graphql_mapping_template_1.iff)((0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('filterEpression.expressionValues.size')), (0, graphql_mapping_template_1.int)(0)), (0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('filterEpression.remove'), (0, graphql_mapping_template_1.str)('expressionValues')))),
|
|
95
|
+
(0, graphql_mapping_template_1.set)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('filterExpression')),
|
|
96
96
|
])),
|
|
97
97
|
])),
|
|
98
|
-
graphql_mapping_template_1.obj({
|
|
99
|
-
version: graphql_mapping_template_1.str('2018-05-29'),
|
|
100
|
-
operation: graphql_mapping_template_1.str('Sync'),
|
|
101
|
-
filter: graphql_mapping_template_1.ifElse(graphql_mapping_template_1.ref('filter'), graphql_mapping_template_1.ref('util.toJson($filter)'), graphql_mapping_template_1.nul()),
|
|
102
|
-
limit: graphql_mapping_template_1.ref(`util.defaultIfNull($ctx.args.limit, ${graphql_transformer_common_1.ResourceConstants.DEFAULT_SYNC_QUERY_PAGE_LIMIT})`),
|
|
103
|
-
lastSync: graphql_mapping_template_1.ref('util.toJson($util.defaultIfNull($ctx.args.lastSync, null))'),
|
|
104
|
-
nextToken: graphql_mapping_template_1.ref('util.toJson($util.defaultIfNull($ctx.args.nextToken, null))'),
|
|
98
|
+
(0, graphql_mapping_template_1.obj)({
|
|
99
|
+
version: (0, graphql_mapping_template_1.str)('2018-05-29'),
|
|
100
|
+
operation: (0, graphql_mapping_template_1.str)('Sync'),
|
|
101
|
+
filter: (0, graphql_mapping_template_1.ifElse)((0, graphql_mapping_template_1.ref)('filter'), (0, graphql_mapping_template_1.ref)('util.toJson($filter)'), (0, graphql_mapping_template_1.nul)()),
|
|
102
|
+
limit: (0, graphql_mapping_template_1.ref)(`util.defaultIfNull($ctx.args.limit, ${graphql_transformer_common_1.ResourceConstants.DEFAULT_SYNC_QUERY_PAGE_LIMIT})`),
|
|
103
|
+
lastSync: (0, graphql_mapping_template_1.ref)('util.toJson($util.defaultIfNull($ctx.args.lastSync, null))'),
|
|
104
|
+
nextToken: (0, graphql_mapping_template_1.ref)('util.toJson($util.defaultIfNull($ctx.args.nextToken, null))'),
|
|
105
105
|
}),
|
|
106
106
|
]));
|
|
107
107
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/resolvers/query.ts"],"names":[],"mappings":";;;AAAA,uEAsBkC;AAClC,2EAA+D;AAC/D,MAAM,UAAU,GAAG,8BAAG,
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/resolvers/query.ts"],"names":[],"mappings":";;;AAAA,uEAsBkC;AAClC,2EAA+D;AAC/D,MAAM,UAAU,GAAG,IAAA,8BAAG,EAAC,sBAAsB,CAAC,CAAC;AAKxC,MAAM,0BAA0B,GAAG,GAAW,EAAE;IACrD,MAAM,UAAU,GAAiB;QAC/B,IAAA,8BAAG,EAAC,IAAA,8BAAG,EAAC,YAAY,CAAC,EAAE,IAAA,8BAAG,EAAC,EAAE,OAAO,EAAE,IAAA,8BAAG,EAAC,YAAY,CAAC,EAAE,SAAS,EAAE,IAAA,8BAAG,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACpF,IAAA,iCAAM,EACJ,IAAA,8BAAG,EAAC,mC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AC,CAAC,EAAE,IAAA,8BAAG,EAAC,CAAC,CAAC,CAAC,EACxE,IAAA,+BAAI,EAAC,IAAA,qCAAU,EAAC,IAAA,8BAAG,EAAC,wBAAwB,CAAC,EAAE,IAAA,8BAAG,EAAC,kBAAkB,CAAC,CAAC,CAAC,CACzE;gBACD,IAAA,8BAAG,EAAC,IAAA,8BAAG,EAAC,QAAQ,CAAC,EAAE,IAAA,8BAAG,EAAC,kBAAkB,CAAC,CAAC;aAC5C,CAAC,CACH;SACF,CAAC,CACH;QACD,IAAA,8BAAG,EAAC;YACF,OAAO,EAAE,IAAA,8BAAG,EAAC,YAAY,CAAC;YAC1B,SAAS,EAAE,IAAA,8BAAG,EAAC,MAAM,CAAC;YACtB,MAAM,EAAE,IAAA,iCAAM,EAAC,IAAA,8BAAG,EAAC,QAAQ,CAAC,EAAE,IAAA,8BAAG,EAAC,sBAAsB,CAAC,EAAE,IAAA,8BAAG,GAAE,CAAC;YACjE,KAAK,EAAE,IAAA,8BAAG,EAAC,uCAAuC,8CAAiB,CAAC,6BAA6B,GAAG,CAAC;YACrG,QAAQ,EAAE,IAAA,8BAAG,EAAC,4DAA4D,CAAC;YAC3E,SAAS,EAAE,IAAA,8BAAG,EAAC,6DAA6D,CAAC;SAC9E,CAAC;KACH,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,2BAA2B,+BAwCtC"}
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateSubscriptionResponseTemplate = exports.generateSubscriptionRequestTemplate = void 0;
|
|
4
4
|
const graphql_mapping_template_1 = require("graphql-mapping-template");
|
|
5
5
|
const generateSubscriptionRequestTemplate = () => {
|
|
6
|
-
const statements = [graphql_mapping_template_1.toJson(graphql_mapping_template_1.obj({ version: graphql_mapping_template_1.str('2018-05-29'), payload: graphql_mapping_template_1.obj({}) }))];
|
|
7
|
-
return graphql_mapping_template_1.printBlock('Subscription Request template')(graphql_mapping_template_1.compoundExpression(statements));
|
|
6
|
+
const statements = [(0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.obj)({ version: (0, graphql_mapping_template_1.str)('2018-05-29'), payload: (0, graphql_mapping_template_1.obj)({}) }))];
|
|
7
|
+
return (0, graphql_mapping_template_1.printBlock)('Subscription Request template')((0, graphql_mapping_template_1.compoundExpression)(statements));
|
|
8
8
|
};
|
|
9
9
|
exports.generateSubscriptionRequestTemplate = generateSubscriptionRequestTemplate;
|
|
10
10
|
const generateSubscriptionResponseTemplate = () => {
|
|
11
|
-
const statements = [graphql_mapping_template_1.toJson(graphql_mapping_template_1.nul())];
|
|
12
|
-
return graphql_mapping_template_1.printBlock('Subscription Response template')(graphql_mapping_template_1.compoundExpression(statements));
|
|
11
|
+
const statements = [(0, graphql_mapping_template_1.toJson)((0, graphql_mapping_template_1.nul)())];
|
|
12
|
+
return (0, graphql_mapping_template_1.printBlock)('Subscription Response template')((0, graphql_mapping_template_1.compoundExpression)(statements));
|
|
13
13
|
};
|
|
14
14
|
exports.generateSubscriptionResponseTemplate = generateSubscriptionResponseTemplate;
|
|
15
15
|
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/resolvers/subscriptions.ts"],"names":[],"mappings":";;;AAAA,uEAA6G;AAEtG,MAAM,mCAAmC,GAAG,GAAW,EAAE;IAC9D,MAAM,UAAU,GAAiB,CAAC,iCAAM,
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/resolvers/subscriptions.ts"],"names":[],"mappings":";;;AAAA,uEAA6G;AAEtG,MAAM,mCAAmC,GAAG,GAAW,EAAE;IAC9D,MAAM,UAAU,GAAiB,CAAC,IAAA,iCAAM,EAAC,IAAA,8BAAG,EAAC,EAAE,OAAO,EAAE,IAAA,8BAAG,EAAC,YAAY,CAAC,EAAE,OAAO,EAAE,IAAA,8BAAG,EAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjG,OAAO,IAAA,qCAAU,EAAC,+BAA+B,CAAC,CAAC,IAAA,6CAAkB,EAAC,UAAU,CAAC,CAAC,CAAC;AACrF,CAAC,CAAC;AAHW,QAAA,mCAAmC,uCAG9C;AAEK,MAAM,oCAAoC,GAAG,GAAW,EAAE;IAC/D,MAAM,UAAU,GAAiB,CAAC,IAAA,iCAAM,EAAC,IAAA,8BAAG,GAAE,CAAC,CAAC,CAAC;IACjD,OAAO,IAAA,qCAAU,EAAC,gCAAgC,CAAC,CAAC,IAAA,6CAAkB,EAAC,UAAU,CAAC,CAAC,CAAC;AACtF,CAAC,CAAC;AAHW,QAAA,oCAAoC,wCAG/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/graphql-model-transformer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5-apiext5.0",
|
|
4
4
|
"description": "Amplify graphql @model transformer",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"test-watch": "jest --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aws-amplify/graphql-transformer-core": "0.
|
|
32
|
-
"@aws-amplify/graphql-transformer-interfaces": "1.12.3
|
|
31
|
+
"@aws-amplify/graphql-transformer-core": "0.13.3-apiext5.0",
|
|
32
|
+
"@aws-amplify/graphql-transformer-interfaces": "1.12.3",
|
|
33
33
|
"@aws-cdk/assets": "~1.124.0",
|
|
34
34
|
"@aws-cdk/aws-applicationautoscaling": "~1.124.0",
|
|
35
35
|
"@aws-cdk/aws-appsync": "~1.124.0",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@aws-cdk/region-info": "~1.124.0",
|
|
58
58
|
"constructs": "^3.3.125",
|
|
59
59
|
"graphql": "^14.5.8",
|
|
60
|
-
"graphql-mapping-template": "4.20.
|
|
61
|
-
"graphql-transformer-common": "4.22.
|
|
60
|
+
"graphql-mapping-template": "4.20.1",
|
|
61
|
+
"graphql-transformer-common": "4.22.2",
|
|
62
62
|
"lodash": "^4.17.21",
|
|
63
63
|
"md5": "^2.3.0"
|
|
64
64
|
},
|
|
@@ -81,7 +81,10 @@
|
|
|
81
81
|
"json",
|
|
82
82
|
"node"
|
|
83
83
|
],
|
|
84
|
-
"collectCoverage": true
|
|
84
|
+
"collectCoverage": true,
|
|
85
|
+
"modulePathIgnorePatterns": [
|
|
86
|
+
"overrides"
|
|
87
|
+
]
|
|
85
88
|
},
|
|
86
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "5cb3a127872e34ba86995cd23e44b2264817526f"
|
|
87
90
|
}
|