@marlonjd/graphql-relational-transformer-stack-limits 3.1.13-stack-limits.3
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/API.md +97 -0
- package/CHANGELOG.md +807 -0
- package/README.md +43 -0
- package/jest.config.js +12 -0
- package/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.d.ts +11 -0
- package/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.d.ts.map +1 -0
- package/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.js +37 -0
- package/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.js.map +1 -0
- package/lib/belongs-to/belongs-to-directive-ddb-references-transformer.d.ts +11 -0
- package/lib/belongs-to/belongs-to-directive-ddb-references-transformer.d.ts.map +1 -0
- package/lib/belongs-to/belongs-to-directive-ddb-references-transformer.js +37 -0
- package/lib/belongs-to/belongs-to-directive-ddb-references-transformer.js.map +1 -0
- package/lib/belongs-to/belongs-to-directive-sql-transformer.d.ts +11 -0
- package/lib/belongs-to/belongs-to-directive-sql-transformer.d.ts.map +1 -0
- package/lib/belongs-to/belongs-to-directive-sql-transformer.js +32 -0
- package/lib/belongs-to/belongs-to-directive-sql-transformer.js.map +1 -0
- package/lib/belongs-to/belongs-to-directive-transformer-factory.d.ts +5 -0
- package/lib/belongs-to/belongs-to-directive-transformer-factory.d.ts.map +1 -0
- package/lib/belongs-to/belongs-to-directive-transformer-factory.js +32 -0
- package/lib/belongs-to/belongs-to-directive-transformer-factory.js.map +1 -0
- package/lib/data-source-based-directive-transformer.d.ts +11 -0
- package/lib/data-source-based-directive-transformer.d.ts.map +1 -0
- package/lib/data-source-based-directive-transformer.js +3 -0
- package/lib/data-source-based-directive-transformer.js.map +1 -0
- package/lib/graphql-belongs-to-transformer.d.ts +13 -0
- package/lib/graphql-belongs-to-transformer.d.ts.map +1 -0
- package/lib/graphql-belongs-to-transformer.js +139 -0
- package/lib/graphql-belongs-to-transformer.js.map +1 -0
- package/lib/graphql-has-many-transformer.d.ts +13 -0
- package/lib/graphql-has-many-transformer.d.ts.map +1 -0
- package/lib/graphql-has-many-transformer.js +120 -0
- package/lib/graphql-has-many-transformer.js.map +1 -0
- package/lib/graphql-has-one-transformer.d.ts +13 -0
- package/lib/graphql-has-one-transformer.d.ts.map +1 -0
- package/lib/graphql-has-one-transformer.js +132 -0
- package/lib/graphql-has-one-transformer.js.map +1 -0
- package/lib/graphql-many-to-many-transformer.d.ts +22 -0
- package/lib/graphql-many-to-many-transformer.d.ts.map +1 -0
- package/lib/graphql-many-to-many-transformer.js +384 -0
- package/lib/graphql-many-to-many-transformer.js.map +1 -0
- package/lib/has-many/has-many-directive-ddb-fields-transformer.d.ts +11 -0
- package/lib/has-many/has-many-directive-ddb-fields-transformer.d.ts.map +1 -0
- package/lib/has-many/has-many-directive-ddb-fields-transformer.js +36 -0
- package/lib/has-many/has-many-directive-ddb-fields-transformer.js.map +1 -0
- package/lib/has-many/has-many-directive-ddb-references-transformer.d.ts +11 -0
- package/lib/has-many/has-many-directive-ddb-references-transformer.d.ts.map +1 -0
- package/lib/has-many/has-many-directive-ddb-references-transformer.js +52 -0
- package/lib/has-many/has-many-directive-ddb-references-transformer.js.map +1 -0
- package/lib/has-many/has-many-directive-sql-transformer.d.ts +11 -0
- package/lib/has-many/has-many-directive-sql-transformer.d.ts.map +1 -0
- package/lib/has-many/has-many-directive-sql-transformer.js +32 -0
- package/lib/has-many/has-many-directive-sql-transformer.js.map +1 -0
- package/lib/has-many/has-many-directive-transformer-factory.d.ts +5 -0
- package/lib/has-many/has-many-directive-transformer-factory.d.ts.map +1 -0
- package/lib/has-many/has-many-directive-transformer-factory.js +32 -0
- package/lib/has-many/has-many-directive-transformer-factory.js.map +1 -0
- package/lib/has-one/has-one-directive-ddb-fields-transformer.d.ts +11 -0
- package/lib/has-one/has-one-directive-ddb-fields-transformer.d.ts.map +1 -0
- package/lib/has-one/has-one-directive-ddb-fields-transformer.js +34 -0
- package/lib/has-one/has-one-directive-ddb-fields-transformer.js.map +1 -0
- package/lib/has-one/has-one-directive-ddb-references-transformer.d.ts +11 -0
- package/lib/has-one/has-one-directive-ddb-references-transformer.d.ts.map +1 -0
- package/lib/has-one/has-one-directive-ddb-references-transformer.js +52 -0
- package/lib/has-one/has-one-directive-ddb-references-transformer.js.map +1 -0
- package/lib/has-one/has-one-directive-sql-transformer.d.ts +11 -0
- package/lib/has-one/has-one-directive-sql-transformer.d.ts.map +1 -0
- package/lib/has-one/has-one-directive-sql-transformer.js +32 -0
- package/lib/has-one/has-one-directive-sql-transformer.js.map +1 -0
- package/lib/has-one/has-one-directive-transformer-factory.d.ts +5 -0
- package/lib/has-one/has-one-directive-transformer-factory.d.ts.map +1 -0
- package/lib/has-one/has-one-directive-transformer-factory.js +32 -0
- package/lib/has-one/has-one-directive-transformer-factory.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +16 -0
- package/lib/index.js.map +1 -0
- package/lib/resolver/ddb-generator.d.ts +14 -0
- package/lib/resolver/ddb-generator.d.ts.map +1 -0
- package/lib/resolver/ddb-generator.js +188 -0
- package/lib/resolver/ddb-generator.js.map +1 -0
- package/lib/resolver/ddb-references-generator.d.ts +11 -0
- package/lib/resolver/ddb-references-generator.d.ts.map +1 -0
- package/lib/resolver/ddb-references-generator.js +216 -0
- package/lib/resolver/ddb-references-generator.js.map +1 -0
- package/lib/resolver/generator-factory.d.ts +4 -0
- package/lib/resolver/generator-factory.d.ts.map +1 -0
- package/lib/resolver/generator-factory.js +18 -0
- package/lib/resolver/generator-factory.js.map +1 -0
- package/lib/resolver/generator.d.ts +8 -0
- package/lib/resolver/generator.d.ts.map +1 -0
- package/lib/resolver/generator.js +7 -0
- package/lib/resolver/generator.js.map +1 -0
- package/lib/resolver/rds-generator.d.ts +16 -0
- package/lib/resolver/rds-generator.d.ts.map +1 -0
- package/lib/resolver/rds-generator.js +148 -0
- package/lib/resolver/rds-generator.js.map +1 -0
- package/lib/resolvers.d.ts +8 -0
- package/lib/resolvers.d.ts.map +1 -0
- package/lib/resolvers.js +246 -0
- package/lib/resolvers.js.map +1 -0
- package/lib/schema.d.ts +15 -0
- package/lib/schema.d.ts.map +1 -0
- package/lib/schema.js +379 -0
- package/lib/schema.js.map +1 -0
- package/lib/types.d.ts +79 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/utils.d.ts +43 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +465 -0
- package/lib/utils.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ManyToManyTransformer = void 0;
|
|
7
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
|
8
|
+
const graphql_directives_1 = require("@aws-amplify/graphql-directives");
|
|
9
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
10
|
+
const graphql_1 = require("graphql");
|
|
11
|
+
const graphql_transformer_common_1 = require("graphql-transformer-common");
|
|
12
|
+
const immer_1 = __importDefault(require("immer"));
|
|
13
|
+
const utils_1 = require("./utils");
|
|
14
|
+
const resolvers_1 = require("./resolvers");
|
|
15
|
+
const schema_1 = require("./schema");
|
|
16
|
+
const ddb_generator_1 = require("./resolver/ddb-generator");
|
|
17
|
+
class ManyToManyTransformer extends graphql_transformer_core_1.TransformerPluginBase {
|
|
18
|
+
constructor(modelTransformer, indexTransformer, hasOneTransformer, authProvider) {
|
|
19
|
+
super('amplify-many-to-many-transformer', graphql_directives_1.ManyToManyDirective.definition);
|
|
20
|
+
this.relationMap = new Map();
|
|
21
|
+
this.directiveList = [];
|
|
22
|
+
this.field = (parent, definition, directive, context) => {
|
|
23
|
+
const directiveWrapped = new graphql_transformer_core_1.DirectiveWrapper(directive);
|
|
24
|
+
const args = directiveWrapped.getArguments({
|
|
25
|
+
directiveName: graphql_directives_1.ManyToManyDirective.name,
|
|
26
|
+
object: parent,
|
|
27
|
+
field: definition,
|
|
28
|
+
directive,
|
|
29
|
+
limit: graphql_directives_1.ManyToManyDirective.defaults.limit,
|
|
30
|
+
}, (0, graphql_transformer_core_1.generateGetArgumentsInput)(context.transformParameters));
|
|
31
|
+
(0, utils_1.validateModelDirective)(args);
|
|
32
|
+
args.connectionFields = [];
|
|
33
|
+
if (!(0, graphql_transformer_common_1.isListType)(definition.type)) {
|
|
34
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} must be used with a list.`);
|
|
35
|
+
}
|
|
36
|
+
addDirectiveToRelationMap(this.relationMap, args);
|
|
37
|
+
this.directiveList.push(args);
|
|
38
|
+
this.relationMap.forEach((manyToManyRelation, _) => addJoinTableToDatasourceStrategies(context, manyToManyRelation));
|
|
39
|
+
};
|
|
40
|
+
this.mutateSchema = (context) => {
|
|
41
|
+
const manyToManyMap = new Map();
|
|
42
|
+
const newDocument = (0, immer_1.default)(context.inputDocument, (draftDoc) => {
|
|
43
|
+
var _a;
|
|
44
|
+
const filteredDefs = (_a = draftDoc === null || draftDoc === void 0 ? void 0 : draftDoc.definitions) === null || _a === void 0 ? void 0 : _a.filter((def) => def.kind === 'ObjectTypeExtension' || def.kind === 'ObjectTypeDefinition');
|
|
45
|
+
const objectDefs = filteredDefs;
|
|
46
|
+
objectDefs === null || objectDefs === void 0 ? void 0 : objectDefs.forEach((def) => {
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = def === null || def === void 0 ? void 0 : def.fields) === null || _a === void 0 ? void 0 : _a.forEach((field) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
(_b = (_a = field === null || field === void 0 ? void 0 : field.directives) === null || _a === void 0 ? void 0 : _a.filter((dir) => dir.name.value === graphql_directives_1.ManyToManyDirective.name)) === null || _b === void 0 ? void 0 : _b.forEach((dir) => {
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
52
|
+
const relationArg = (_a = dir === null || dir === void 0 ? void 0 : dir.arguments) === null || _a === void 0 ? void 0 : _a.find((arg) => arg.name.value === 'relationName');
|
|
53
|
+
if (((_b = relationArg === null || relationArg === void 0 ? void 0 : relationArg.value) === null || _b === void 0 ? void 0 : _b.kind) === 'StringValue') {
|
|
54
|
+
const relationName = relationArg.value.value;
|
|
55
|
+
const manyToManyContext = {
|
|
56
|
+
model: def,
|
|
57
|
+
field,
|
|
58
|
+
directive: dir,
|
|
59
|
+
modelAuthDirectives: (_d = (_c = def === null || def === void 0 ? void 0 : def.directives) === null || _c === void 0 ? void 0 : _c.filter((authDir) => authDir.name.value === 'auth')) !== null && _d !== void 0 ? _d : [],
|
|
60
|
+
fieldAuthDirectives: (_f = (_e = def === null || def === void 0 ? void 0 : def.directives) === null || _e === void 0 ? void 0 : _e.filter((authDir) => authDir.name.value === 'auth')) !== null && _f !== void 0 ? _f : [],
|
|
61
|
+
relationName,
|
|
62
|
+
};
|
|
63
|
+
if (!manyToManyMap.has(relationName)) {
|
|
64
|
+
manyToManyMap.set(relationName, []);
|
|
65
|
+
}
|
|
66
|
+
(_g = manyToManyMap.get(relationName)) === null || _g === void 0 ? void 0 : _g.push(manyToManyContext);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
manyToManyMap.forEach((value, key) => {
|
|
72
|
+
if (value.length !== 2) {
|
|
73
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`relationNames should have 2 occurrences. '${key}' has '${value.length}' occurrences`);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
manyToManyMap.forEach((value, key) => {
|
|
77
|
+
var _a, _b, _c, _d;
|
|
78
|
+
const manyToManyOne = value[0];
|
|
79
|
+
const manyToManyTwo = value[1];
|
|
80
|
+
const d1origTypeName = context.schemaHelper.getTypeMapping(manyToManyOne.model.name.value);
|
|
81
|
+
const d2origTypeName = context.schemaHelper.getTypeMapping(manyToManyTwo.model.name.value);
|
|
82
|
+
const d1TypeName = manyToManyOne.model.name.value;
|
|
83
|
+
const d2TypeName = manyToManyTwo.model.name.value;
|
|
84
|
+
const d1FieldName = d1TypeName.charAt(0).toLowerCase() + d1TypeName.slice(1);
|
|
85
|
+
const d2FieldName = d2TypeName.charAt(0).toLowerCase() + d2TypeName.slice(1);
|
|
86
|
+
const d1FieldNameOrig = d1origTypeName.charAt(0).toLowerCase() + d1origTypeName.slice(1);
|
|
87
|
+
const d2FieldNameOrig = d2origTypeName.charAt(0).toLowerCase() + d2origTypeName.slice(1);
|
|
88
|
+
const d1PartitionKey = (0, schema_1.getPartitionKeyFieldNoContext)(manyToManyOne.model);
|
|
89
|
+
const d1SortKeys = (0, schema_1.getSortKeyFieldsNoContext)(manyToManyOne.model);
|
|
90
|
+
const d2PartitionKey = (0, schema_1.getPartitionKeyFieldNoContext)(manyToManyTwo.model);
|
|
91
|
+
const d2SortKeys = (0, schema_1.getSortKeyFieldsNoContext)(manyToManyTwo.model);
|
|
92
|
+
const d1IndexName = `by${d1origTypeName}`;
|
|
93
|
+
const d2IndexName = `by${d2origTypeName}`;
|
|
94
|
+
const d1FieldNameId = (0, utils_1.getManyToManyConnectionAttributeName)(context.transformParameters, d1FieldName, (0, utils_1.getObjectPrimaryKey)(manyToManyOne.model).name.value);
|
|
95
|
+
const d1SortFieldNames = d1SortKeys.map((node) => `${d1FieldNameOrig}${node.name.value}`);
|
|
96
|
+
const d2FieldNameId = (0, utils_1.getManyToManyConnectionAttributeName)(context.transformParameters, d2FieldName, (0, utils_1.getObjectPrimaryKey)(manyToManyTwo.model).name.value);
|
|
97
|
+
const d2SortFieldNames = d2SortKeys.map((node) => `${d2FieldNameOrig}${node.name.value}`);
|
|
98
|
+
const joinModelDirective = (0, graphql_transformer_common_1.makeDirective)('model', []);
|
|
99
|
+
const d1IndexDirective = (0, graphql_transformer_common_1.makeDirective)('index', [
|
|
100
|
+
(0, graphql_transformer_common_1.makeArgument)('name', (0, graphql_transformer_common_1.makeValueNode)(d1IndexName)),
|
|
101
|
+
(0, graphql_transformer_common_1.makeArgument)('sortKeyFields', (0, graphql_transformer_common_1.makeValueNode)([...d1SortFieldNames])),
|
|
102
|
+
]);
|
|
103
|
+
const d2IndexDirective = (0, graphql_transformer_common_1.makeDirective)('index', [
|
|
104
|
+
(0, graphql_transformer_common_1.makeArgument)('name', (0, graphql_transformer_common_1.makeValueNode)(d2IndexName)),
|
|
105
|
+
(0, graphql_transformer_common_1.makeArgument)('sortKeyFields', (0, graphql_transformer_common_1.makeValueNode)([...d2SortFieldNames])),
|
|
106
|
+
]);
|
|
107
|
+
const d1HasOneDirective = (0, graphql_transformer_common_1.makeDirective)('hasOne', [(0, graphql_transformer_common_1.makeArgument)('fields', (0, graphql_transformer_common_1.makeValueNode)([d1FieldNameId, ...d1SortFieldNames]))]);
|
|
108
|
+
const d2HasOneDirective = (0, graphql_transformer_common_1.makeDirective)('hasOne', [(0, graphql_transformer_common_1.makeArgument)('fields', (0, graphql_transformer_common_1.makeValueNode)([d2FieldNameId, ...d2SortFieldNames]))]);
|
|
109
|
+
const d1RelatedField = (0, graphql_transformer_common_1.makeField)(d1FieldNameId, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(d1PartitionKey.type))), [
|
|
110
|
+
d1IndexDirective,
|
|
111
|
+
]);
|
|
112
|
+
const d1RelatedSortKeyFields = d1SortKeys.map((node) => (0, graphql_transformer_common_1.makeField)(`${d1FieldName}${node.name.value}`, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(node.type)))));
|
|
113
|
+
const d2RelatedField = (0, graphql_transformer_common_1.makeField)(d2FieldNameId, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(d2PartitionKey.type))), [
|
|
114
|
+
d2IndexDirective,
|
|
115
|
+
]);
|
|
116
|
+
const d2RelatedSortKeyFields = d2SortKeys.map((node) => (0, graphql_transformer_common_1.makeField)(`${d2FieldName}${node.name.value}`, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(node.type)))));
|
|
117
|
+
const d1Field = (0, graphql_transformer_common_1.makeField)(d1FieldName, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)(d1TypeName)), [d1HasOneDirective]);
|
|
118
|
+
const d2Field = (0, graphql_transformer_common_1.makeField)(d2FieldName, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)(d2TypeName)), [d2HasOneDirective]);
|
|
119
|
+
const joinTableDirectives = [joinModelDirective];
|
|
120
|
+
const joinTableAuthDirective = createJoinTableAuthDirective(manyToManyOne.model, manyToManyTwo.model);
|
|
121
|
+
if (joinTableAuthDirective) {
|
|
122
|
+
joinTableDirectives.push(joinTableAuthDirective);
|
|
123
|
+
}
|
|
124
|
+
const joinType = {
|
|
125
|
+
...(0, graphql_transformer_common_1.blankObject)(manyToManyOne.relationName),
|
|
126
|
+
fields: [
|
|
127
|
+
(0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
|
128
|
+
d1RelatedField,
|
|
129
|
+
...d1RelatedSortKeyFields,
|
|
130
|
+
d2RelatedField,
|
|
131
|
+
...d2RelatedSortKeyFields,
|
|
132
|
+
d1Field,
|
|
133
|
+
d2Field,
|
|
134
|
+
],
|
|
135
|
+
directives: joinTableDirectives,
|
|
136
|
+
};
|
|
137
|
+
const d1SortKeyNames = d1SortKeys.map((field) => field.name.value);
|
|
138
|
+
const d2SortKeyNames = d2SortKeys.map((field) => field.name.value);
|
|
139
|
+
const hasManyOne = (0, graphql_transformer_common_1.makeDirective)('hasMany', [
|
|
140
|
+
(0, graphql_transformer_common_1.makeArgument)('indexName', (0, graphql_transformer_common_1.makeValueNode)(d1IndexName)),
|
|
141
|
+
(0, graphql_transformer_common_1.makeArgument)('fields', (0, graphql_transformer_common_1.makeValueNode)([d1PartitionKey.name.value, ...d1SortKeyNames])),
|
|
142
|
+
]);
|
|
143
|
+
const hasManyTwo = (0, graphql_transformer_common_1.makeDirective)('hasMany', [
|
|
144
|
+
(0, graphql_transformer_common_1.makeArgument)('indexName', (0, graphql_transformer_common_1.makeValueNode)(d2IndexName)),
|
|
145
|
+
(0, graphql_transformer_common_1.makeArgument)('fields', (0, graphql_transformer_common_1.makeValueNode)([d2PartitionKey.name.value, ...d2SortKeyNames])),
|
|
146
|
+
]);
|
|
147
|
+
(_b = (_a = manyToManyOne === null || manyToManyOne === void 0 ? void 0 : manyToManyOne.field) === null || _a === void 0 ? void 0 : _a.directives) === null || _b === void 0 ? void 0 : _b.push(hasManyOne);
|
|
148
|
+
(_d = (_c = manyToManyTwo === null || manyToManyTwo === void 0 ? void 0 : manyToManyTwo.field) === null || _c === void 0 ? void 0 : _c.directives) === null || _d === void 0 ? void 0 : _d.push(hasManyTwo);
|
|
149
|
+
let baseTypeD1 = manyToManyOne.field.type;
|
|
150
|
+
let baseTypeD2 = manyToManyOne.field.type;
|
|
151
|
+
while (baseTypeD1.kind !== 'NamedType') {
|
|
152
|
+
baseTypeD1 = baseTypeD1.type;
|
|
153
|
+
}
|
|
154
|
+
while (baseTypeD2.kind !== 'NamedType') {
|
|
155
|
+
baseTypeD2 = baseTypeD2.type;
|
|
156
|
+
}
|
|
157
|
+
baseTypeD1.name.value = manyToManyOne.relationName;
|
|
158
|
+
baseTypeD2.name.value = manyToManyTwo.relationName;
|
|
159
|
+
draftDoc.definitions.push(joinType);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
return newDocument;
|
|
163
|
+
};
|
|
164
|
+
this.validate = (ctx) => {
|
|
165
|
+
this.relationMap.forEach((relation) => {
|
|
166
|
+
const { directive1, directive2, name } = relation;
|
|
167
|
+
if (!directive2) {
|
|
168
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} relation '${name}' must be used in exactly two locations.`);
|
|
169
|
+
}
|
|
170
|
+
const d1ExpectedType = (0, graphql_transformer_common_1.getBaseType)(directive1.field.type);
|
|
171
|
+
const d2ExpectedType = (0, graphql_transformer_common_1.getBaseType)(directive2.field.type);
|
|
172
|
+
if ((0, graphql_transformer_core_1.isSqlModel)(ctx, d1ExpectedType) || (0, graphql_transformer_core_1.isSqlModel)(ctx, d2ExpectedType)) {
|
|
173
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} directive cannot be used on a SQL model.`);
|
|
174
|
+
}
|
|
175
|
+
const d1Strategy = (0, graphql_transformer_core_1.getModelDataSourceStrategy)(ctx, d1ExpectedType);
|
|
176
|
+
const d2Strategy = (0, graphql_transformer_core_1.getModelDataSourceStrategy)(ctx, d2ExpectedType);
|
|
177
|
+
if (((0, graphql_transformer_core_1.isDefaultDynamoDbModelDataSourceStrategy)(d1Strategy) && !(0, graphql_transformer_core_1.isDefaultDynamoDbModelDataSourceStrategy)(d2Strategy)) ||
|
|
178
|
+
((0, graphql_transformer_core_1.isAmplifyDynamoDbModelDataSourceStrategy)(d1Strategy) && !(0, graphql_transformer_core_1.isAmplifyDynamoDbModelDataSourceStrategy)(d2Strategy))) {
|
|
179
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} directive cannot be used to relate models with a different DynamoDB-based strategies.`);
|
|
180
|
+
}
|
|
181
|
+
if (d1ExpectedType !== directive2.object.name.value) {
|
|
182
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} relation '${name}' expects '${d1ExpectedType}' but got '${directive2.object.name.value}'.`);
|
|
183
|
+
}
|
|
184
|
+
if (d2ExpectedType !== directive1.object.name.value) {
|
|
185
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} relation '${name}' expects '${d2ExpectedType}' but got '${directive1.object.name.value}'.`);
|
|
186
|
+
}
|
|
187
|
+
if (ctx.output.hasType(name)) {
|
|
188
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} relation name '${name}' (derived from '${directive1.relationName}') already exists as a type in the schema.`);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
this.prepare = (ctx) => {
|
|
193
|
+
const context = ctx;
|
|
194
|
+
if (!ctx.metadata.has('joinTypeList')) {
|
|
195
|
+
ctx.metadata.set('joinTypeList', []);
|
|
196
|
+
}
|
|
197
|
+
this.relationMap.forEach((relation) => {
|
|
198
|
+
const { directive1, directive2, name } = relation;
|
|
199
|
+
ctx.metadata.get('joinTypeList').push(name);
|
|
200
|
+
const d1origTypeName = ctx.resourceHelper.getModelNameMapping(directive1.object.name.value);
|
|
201
|
+
const d2origTypeName = ctx.resourceHelper.getModelNameMapping(directive2.object.name.value);
|
|
202
|
+
const d1TypeName = directive1.object.name.value;
|
|
203
|
+
const d2TypeName = directive2.object.name.value;
|
|
204
|
+
const d1FieldName = d1TypeName.charAt(0).toLowerCase() + d1TypeName.slice(1);
|
|
205
|
+
const d2FieldName = d2TypeName.charAt(0).toLowerCase() + d2TypeName.slice(1);
|
|
206
|
+
const d1FieldNameOrig = d1origTypeName.charAt(0).toLowerCase() + d1origTypeName.slice(1);
|
|
207
|
+
const d2FieldNameOrig = d2origTypeName.charAt(0).toLowerCase() + d2origTypeName.slice(1);
|
|
208
|
+
const d1PartitionKey = (0, schema_1.getPartitionKeyField)(context, directive1.object);
|
|
209
|
+
const d1SortKeys = (0, schema_1.getSortKeyFields)(context, directive1.object);
|
|
210
|
+
const d2PartitionKey = (0, schema_1.getPartitionKeyField)(context, directive2.object);
|
|
211
|
+
const d2SortKeys = (0, schema_1.getSortKeyFields)(context, directive2.object);
|
|
212
|
+
const d1IndexName = `by${d1origTypeName}`;
|
|
213
|
+
const d2IndexName = `by${d2origTypeName}`;
|
|
214
|
+
const d1FieldNameId = (0, utils_1.getManyToManyConnectionAttributeName)(ctx.transformParameters, d1FieldName, (0, utils_1.getObjectPrimaryKey)(directive1.object).name.value);
|
|
215
|
+
const d1SortFieldNames = d1SortKeys.map((node) => `${d1FieldNameOrig}${node.name.value}`);
|
|
216
|
+
const d2FieldNameId = (0, utils_1.getManyToManyConnectionAttributeName)(ctx.transformParameters, d2FieldName, (0, utils_1.getObjectPrimaryKey)(directive2.object).name.value);
|
|
217
|
+
const d1FieldNameIdOrig = (0, utils_1.getManyToManyConnectionAttributeName)(ctx.transformParameters, d1FieldNameOrig, (0, utils_1.getObjectPrimaryKey)(directive1.object).name.value);
|
|
218
|
+
const d2FieldNameIdOrig = (0, utils_1.getManyToManyConnectionAttributeName)(ctx.transformParameters, d2FieldNameOrig, (0, utils_1.getObjectPrimaryKey)(directive2.object).name.value);
|
|
219
|
+
const d2SortFieldNames = d2SortKeys.map((node) => `${d2FieldNameOrig}${node.name.value}`);
|
|
220
|
+
const joinModelDirective = (0, graphql_transformer_common_1.makeDirective)('model', []);
|
|
221
|
+
const d1IndexDirective = (0, graphql_transformer_common_1.makeDirective)('index', [
|
|
222
|
+
(0, graphql_transformer_common_1.makeArgument)('name', (0, graphql_transformer_common_1.makeValueNode)(d1IndexName)),
|
|
223
|
+
(0, graphql_transformer_common_1.makeArgument)('sortKeyFields', (0, graphql_transformer_common_1.makeValueNode)([...d1SortFieldNames])),
|
|
224
|
+
]);
|
|
225
|
+
const d2IndexDirective = (0, graphql_transformer_common_1.makeDirective)('index', [
|
|
226
|
+
(0, graphql_transformer_common_1.makeArgument)('name', (0, graphql_transformer_common_1.makeValueNode)(d2IndexName)),
|
|
227
|
+
(0, graphql_transformer_common_1.makeArgument)('sortKeyFields', (0, graphql_transformer_common_1.makeValueNode)([...d2SortFieldNames])),
|
|
228
|
+
]);
|
|
229
|
+
const d1HasOneDirective = (0, graphql_transformer_common_1.makeDirective)('hasOne', [(0, graphql_transformer_common_1.makeArgument)('fields', (0, graphql_transformer_common_1.makeValueNode)([d1FieldNameId, ...d1SortFieldNames]))]);
|
|
230
|
+
const d2HasOneDirective = (0, graphql_transformer_common_1.makeDirective)('hasOne', [(0, graphql_transformer_common_1.makeArgument)('fields', (0, graphql_transformer_common_1.makeValueNode)([d2FieldNameId, ...d2SortFieldNames]))]);
|
|
231
|
+
const d1RelatedField = (0, graphql_transformer_common_1.makeField)(d1FieldNameId, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(d1PartitionKey.type))), [d1IndexDirective]);
|
|
232
|
+
const d1RelatedSortKeyFields = d1SortKeys.map((node) => (0, graphql_transformer_common_1.makeField)(`${d1FieldName}${node.name.value}`, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(node.type)))));
|
|
233
|
+
const d2RelatedField = (0, graphql_transformer_common_1.makeField)(d2FieldNameId, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(d2PartitionKey.type))), [d2IndexDirective]);
|
|
234
|
+
const d2RelatedSortKeyFields = d2SortKeys.map((node) => (0, graphql_transformer_common_1.makeField)(`${d2FieldName}${node.name.value}`, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(node.type)))));
|
|
235
|
+
const d1Field = (0, graphql_transformer_common_1.makeField)(d1FieldName, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)(d1TypeName)), [d1HasOneDirective]);
|
|
236
|
+
const d2Field = (0, graphql_transformer_common_1.makeField)(d2FieldName, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)(d2TypeName)), [d2HasOneDirective]);
|
|
237
|
+
const joinTableDirectives = [joinModelDirective];
|
|
238
|
+
const joinTableAuthDirective = createJoinTableAuthDirective(directive1.object, directive2.object);
|
|
239
|
+
if (joinTableAuthDirective) {
|
|
240
|
+
joinTableDirectives.push(joinTableAuthDirective);
|
|
241
|
+
}
|
|
242
|
+
const joinType = {
|
|
243
|
+
...(0, graphql_transformer_common_1.blankObject)(name),
|
|
244
|
+
fields: [
|
|
245
|
+
(0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
|
246
|
+
d1RelatedField,
|
|
247
|
+
...d1RelatedSortKeyFields,
|
|
248
|
+
d2RelatedField,
|
|
249
|
+
...d2RelatedSortKeyFields,
|
|
250
|
+
d1Field,
|
|
251
|
+
d2Field,
|
|
252
|
+
],
|
|
253
|
+
directives: joinTableDirectives,
|
|
254
|
+
};
|
|
255
|
+
ctx.output.addObject(joinType);
|
|
256
|
+
directive1.indexName = d1IndexName;
|
|
257
|
+
directive2.indexName = d2IndexName;
|
|
258
|
+
directive1.fields = [d1PartitionKey.name.value, ...d1SortKeys.map((node) => `${node.name.value}`)];
|
|
259
|
+
directive2.fields = [d2PartitionKey.name.value, ...d2SortKeys.map((node) => `${node.name.value}`)];
|
|
260
|
+
directive1.fieldNodes = [d1PartitionKey, ...d1SortKeys];
|
|
261
|
+
directive2.fieldNodes = [d2PartitionKey, ...d2SortKeys];
|
|
262
|
+
directive1.relatedType = joinType;
|
|
263
|
+
directive2.relatedType = joinType;
|
|
264
|
+
directive1.relatedTypeIndex = [d1RelatedField];
|
|
265
|
+
directive2.relatedTypeIndex = [d2RelatedField];
|
|
266
|
+
this.modelTransformer.object(joinType, joinModelDirective, context);
|
|
267
|
+
this.hasOneTransformer.field(joinType, d1Field, d1HasOneDirective, context);
|
|
268
|
+
this.hasOneTransformer.field(joinType, d2Field, d2HasOneDirective, context);
|
|
269
|
+
if (joinTableAuthDirective) {
|
|
270
|
+
this.authProvider.object(joinType, joinTableAuthDirective, context);
|
|
271
|
+
}
|
|
272
|
+
const d1IndexDirectiveOrig = (0, graphql_transformer_common_1.makeDirective)('index', [
|
|
273
|
+
(0, graphql_transformer_common_1.makeArgument)('name', (0, graphql_transformer_common_1.makeValueNode)(d1IndexName)),
|
|
274
|
+
(0, graphql_transformer_common_1.makeArgument)('sortKeyFields', (0, graphql_transformer_common_1.makeValueNode)([...d1SortFieldNames])),
|
|
275
|
+
]);
|
|
276
|
+
const d2IndexDirectiveOrig = (0, graphql_transformer_common_1.makeDirective)('index', [
|
|
277
|
+
(0, graphql_transformer_common_1.makeArgument)('name', (0, graphql_transformer_common_1.makeValueNode)(d2IndexName)),
|
|
278
|
+
(0, graphql_transformer_common_1.makeArgument)('sortKeyFields', (0, graphql_transformer_common_1.makeValueNode)([...d2SortFieldNames])),
|
|
279
|
+
]);
|
|
280
|
+
const d1RelatedFieldOrig = (0, graphql_transformer_common_1.makeField)(d1FieldNameIdOrig, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(d1PartitionKey.type))), [
|
|
281
|
+
d1IndexDirectiveOrig,
|
|
282
|
+
]);
|
|
283
|
+
const d2RelatedFieldOrig = (0, graphql_transformer_common_1.makeField)(d2FieldNameIdOrig, [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)((0, graphql_transformer_common_1.getBaseType)(d2PartitionKey.type))), [
|
|
284
|
+
d2IndexDirectiveOrig,
|
|
285
|
+
]);
|
|
286
|
+
const joinTypeOrig = {
|
|
287
|
+
...(0, graphql_transformer_common_1.blankObject)(name),
|
|
288
|
+
fields: [
|
|
289
|
+
(0, graphql_transformer_common_1.makeField)('id', [], (0, graphql_transformer_common_1.wrapNonNull)((0, graphql_transformer_common_1.makeNamedType)('ID'))),
|
|
290
|
+
d1RelatedFieldOrig,
|
|
291
|
+
...d1RelatedSortKeyFields,
|
|
292
|
+
d2RelatedFieldOrig,
|
|
293
|
+
...d2RelatedSortKeyFields,
|
|
294
|
+
d1Field,
|
|
295
|
+
d2Field,
|
|
296
|
+
],
|
|
297
|
+
directives: joinTableDirectives,
|
|
298
|
+
};
|
|
299
|
+
this.indexTransformer.field(joinTypeOrig, d1RelatedFieldOrig, d1IndexDirectiveOrig, context);
|
|
300
|
+
this.indexTransformer.field(joinTypeOrig, d2RelatedFieldOrig, d2IndexDirectiveOrig, context);
|
|
301
|
+
const renamedFields = [];
|
|
302
|
+
if (ctx.resourceHelper.isModelRenamed(directive1.object.name.value)) {
|
|
303
|
+
renamedFields.push({ originalFieldName: d1FieldNameIdOrig, currentFieldName: d1FieldNameId });
|
|
304
|
+
}
|
|
305
|
+
if (ctx.resourceHelper.isModelRenamed(directive2.object.name.value)) {
|
|
306
|
+
renamedFields.push({ originalFieldName: d2FieldNameIdOrig, currentFieldName: d2FieldNameId });
|
|
307
|
+
}
|
|
308
|
+
if (renamedFields.length && !(0, graphql_transformer_core_1.isSqlModel)(context, name)) {
|
|
309
|
+
(0, utils_1.registerManyToManyForeignKeyMappings)({
|
|
310
|
+
resourceHelper: ctx.resourceHelper,
|
|
311
|
+
typeName: name,
|
|
312
|
+
referencedBy: [
|
|
313
|
+
{ typeName: directive1.object.name.value, fieldName: directive1.field.name.value, isList: true },
|
|
314
|
+
{ typeName: directive2.object.name.value, fieldName: directive2.field.name.value, isList: true },
|
|
315
|
+
],
|
|
316
|
+
fieldMap: renamedFields,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
context.providerRegistry.registerDataSourceProvider(joinType, this.modelTransformer);
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
this.transformSchema = (ctx) => {
|
|
323
|
+
const context = ctx;
|
|
324
|
+
for (const config of this.directiveList) {
|
|
325
|
+
(0, schema_1.ensureHasManyConnectionField)(config, context);
|
|
326
|
+
(0, schema_1.extendTypeWithConnection)(config, context);
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
this.generateResolvers = (ctx) => {
|
|
330
|
+
if (this.directiveList.length === 0) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const context = ctx;
|
|
334
|
+
if (!context.transformParameters.allowGen1Patterns) {
|
|
335
|
+
aws_cdk_lib_1.Annotations.of(context.api).addWarning(`@${graphql_directives_1.ManyToManyDirective.name} is deprecated. This functionality will be removed in the next major release.`);
|
|
336
|
+
}
|
|
337
|
+
for (const config of this.directiveList) {
|
|
338
|
+
(0, resolvers_1.updateTableForConnection)(config, context);
|
|
339
|
+
new ddb_generator_1.DDBRelationalResolverGenerator().makeHasManyGetItemsConnectionWithKeyResolver(config, context);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
this.modelTransformer = modelTransformer;
|
|
343
|
+
this.indexTransformer = indexTransformer;
|
|
344
|
+
this.hasOneTransformer = hasOneTransformer;
|
|
345
|
+
this.authProvider = authProvider;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
exports.ManyToManyTransformer = ManyToManyTransformer;
|
|
349
|
+
const addJoinTableToDatasourceStrategies = (ctx, manyToManyRelation) => {
|
|
350
|
+
const { name: relationName, directive1: { object: { name: { value: typeName }, }, }, } = manyToManyRelation;
|
|
351
|
+
const parentStrategy = (0, graphql_transformer_core_1.getModelDataSourceStrategy)(ctx, typeName);
|
|
352
|
+
ctx.dataSourceStrategies[relationName] = parentStrategy;
|
|
353
|
+
};
|
|
354
|
+
function addDirectiveToRelationMap(map, directive) {
|
|
355
|
+
const { relationName } = directive;
|
|
356
|
+
const gqlName = getGraphqlRelationName(relationName);
|
|
357
|
+
let relation;
|
|
358
|
+
relation = map.get(gqlName);
|
|
359
|
+
if (relation === undefined) {
|
|
360
|
+
relation = { name: gqlName, directive1: directive };
|
|
361
|
+
map.set(gqlName, relation);
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
if (relation.directive2) {
|
|
365
|
+
throw new graphql_transformer_core_1.InvalidDirectiveError(`@${graphql_directives_1.ManyToManyDirective.name} relation '${relationName}' must be used in exactly two locations.`);
|
|
366
|
+
}
|
|
367
|
+
relation.directive2 = directive;
|
|
368
|
+
}
|
|
369
|
+
function getGraphqlRelationName(name) {
|
|
370
|
+
return (0, graphql_transformer_common_1.graphqlName)((0, graphql_transformer_common_1.toUpper)(name));
|
|
371
|
+
}
|
|
372
|
+
function createJoinTableAuthDirective(table1, table2) {
|
|
373
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
374
|
+
const t1Auth = table1.directives.find((directive) => directive.name.value === 'auth');
|
|
375
|
+
const t2Auth = table2.directives.find((directive) => directive.name.value === 'auth');
|
|
376
|
+
const t1Rules = (_d = (_c = (_b = ((_a = t1Auth === null || t1Auth === void 0 ? void 0 : t1Auth.arguments) !== null && _a !== void 0 ? _a : []).find((arg) => arg.name.value === 'rules')) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.values) !== null && _d !== void 0 ? _d : [];
|
|
377
|
+
const t2Rules = (_h = (_g = (_f = ((_e = t2Auth === null || t2Auth === void 0 ? void 0 : t2Auth.arguments) !== null && _e !== void 0 ? _e : []).find((arg) => arg.name.value === 'rules')) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.values) !== null && _h !== void 0 ? _h : [];
|
|
378
|
+
const rules = [...t1Rules, ...t2Rules];
|
|
379
|
+
if (rules.length === 0) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
return (0, graphql_transformer_common_1.makeDirective)('auth', [(0, graphql_transformer_common_1.makeArgument)('rules', { kind: graphql_1.Kind.LIST, values: rules })]);
|
|
383
|
+
}
|
|
384
|
+
//# sourceMappingURL=graphql-many-to-many-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-many-to-many-transformer.js","sourceRoot":"","sources":["../src/graphql-many-to-many-transformer.ts"],"names":[],"mappings":";;;;;;AAAA,oFAW+C;AAa/C,wEAAsE;AACtE,6CAA0C;AAC1C,qCAQiB;AACjB,2EAYoC;AAGpC,kDAA4B;AAG5B,mCAKiB;AACjB,2CAAuD;AACvD,qCAOkB;AAElB,4DAA0E;AAS1E,MAAa,qBAAsB,SAAQ,gDAAqB;IAa9D,YACE,gBAAkC,EAClC,gBAAkC,EAClC,iBAAoC,EACpC,YAAqC;QAErC,KAAK,CAAC,kCAAkC,EAAE,wCAAmB,CAAC,UAAU,CAAC,CAAC;QAlBpE,gBAAW,GAAG,IAAI,GAAG,EAA8B,CAAC;QAEpD,kBAAa,GAAuC,EAAE,CAAC;QAuB/D,UAAK,GAAG,CACN,MAA8D,EAC9D,UAA+B,EAC/B,SAAwB,EACxB,OAAkD,EAC5C,EAAE;YACR,MAAM,gBAAgB,GAAG,IAAI,2CAAgB,CAAC,SAAS,CAAC,CAAC;YACzD,MAAM,IAAI,GAAG,gBAAgB,CAAC,YAAY,CACxC;gBACE,aAAa,EAAE,wCAAmB,CAAC,IAAI;gBACvC,MAAM,EAAE,MAAkC;gBAC1C,KAAK,EAAE,UAAU;gBACjB,SAAS;gBACT,KAAK,EAAE,wCAAmB,CAAC,QAAQ,CAAC,KAAK;aACN,EACrC,IAAA,oDAAyB,EAAC,OAAO,CAAC,mBAAmB,CAAC,CACvD,CAAC;YAEF,IAAA,8BAAsB,EAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;YAE3B,IAAI,CAAC,IAAA,uCAAU,EAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAChC,MAAM,IAAI,gDAAqB,CAAC,IAAI,wCAAmB,CAAC,IAAI,4BAA4B,CAAC,CAAC;aAC3F;YAED,yBAAyB,CAAC,IAAI,CAAC,W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EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC,0CAAE,KAAa,0CAAE,MAAM,mCAAI,EAAE,CAAC;IAClH,MAAM,KAAK,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;IAEvC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,OAAO;KACR;IAGD,OAAO,IAAA,0CAAa,EAAC,MAAM,EAAE,CAAC,IAAA,yCAAY,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,cAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransformerContextProvider, TransformerPrepareStepContextProvider, TransformerTransformSchemaStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
|
2
|
+
import { DataSourceBasedDirectiveTransformer } from '../data-source-based-directive-transformer';
|
|
3
|
+
import { HasManyDirectiveConfiguration } from '../types';
|
|
4
|
+
export declare class HasManyDirectiveDDBFieldsTransformer implements DataSourceBasedDirectiveTransformer<HasManyDirectiveConfiguration> {
|
|
5
|
+
dbType: import("@aws-amplify/graphql-transformer-interfaces").ModelDataSourceStrategyDbType;
|
|
6
|
+
prepare: (context: TransformerPrepareStepContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
7
|
+
transformSchema: (context: TransformerTransformSchemaStepContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
8
|
+
generateResolvers: (context: TransformerContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
9
|
+
validate: (context: TransformerContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=has-many-directive-ddb-fields-transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-many-directive-ddb-fields-transformer.d.ts","sourceRoot":"","sources":["../../src/has-many/has-many-directive-ddb-fields-transformer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,qCAAqC,EACrC,6CAA6C,EAC9C,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mCAAmC,EAAE,MAAM,4CAA4C,CAAC;AAGjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AASzD,qBAAa,oCAAqC,YAAW,mCAAmC,CAAC,6BAA6B,CAAC;IAC7H,MAAM,sFAAe;IAErB,OAAO,YAAa,qCAAqC,UAAU,6BAA6B,KAAG,IAAI,CASrG;IAEF,eAAe,YAAa,6CAA6C,UAAU,6BAA6B,KAAG,IAAI,CAErH;IAEF,iBAAiB,YAAa,0BAA0B,UAAU,6BAA6B,KAAG,IAAI,CAIpG;IAEF,QAAQ,YAAa,0BAA0B,UAAU,6BAA6B,KAAG,IAAI,CAG3F;CACH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasManyDirectiveDDBFieldsTransformer = void 0;
|
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
|
5
|
+
const generator_factory_1 = require("../resolver/generator-factory");
|
|
6
|
+
const resolvers_1 = require("../resolvers");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
class HasManyDirectiveDDBFieldsTransformer {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.dbType = graphql_transformer_core_1.DDB_DB_TYPE;
|
|
11
|
+
this.prepare = (context, config) => {
|
|
12
|
+
const modelName = config.object.name.value;
|
|
13
|
+
(0, utils_1.registerHasManyForeignKeyMappings)({
|
|
14
|
+
transformParameters: context.transformParameters,
|
|
15
|
+
resourceHelper: context.resourceHelper,
|
|
16
|
+
thisTypeName: modelName,
|
|
17
|
+
thisFieldName: config.field.name.value,
|
|
18
|
+
relatedType: config.relatedType,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
this.transformSchema = (context, config) => {
|
|
22
|
+
config.relatedTypeIndex = (0, utils_1.getRelatedTypeIndex)(config, context, config.indexName);
|
|
23
|
+
};
|
|
24
|
+
this.generateResolvers = (context, config) => {
|
|
25
|
+
(0, resolvers_1.updateTableForConnection)(config, context);
|
|
26
|
+
const generator = (0, generator_factory_1.getGenerator)(this.dbType);
|
|
27
|
+
generator.makeHasManyGetItemsConnectionWithKeyResolver(config, context);
|
|
28
|
+
};
|
|
29
|
+
this.validate = (context, config) => {
|
|
30
|
+
(0, utils_1.ensureFieldsArray)(config);
|
|
31
|
+
config.fieldNodes = (0, utils_1.getFieldsNodes)(config, context);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.HasManyDirectiveDDBFieldsTransformer = HasManyDirectiveDDBFieldsTransformer;
|
|
36
|
+
//# sourceMappingURL=has-many-directive-ddb-fields-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-many-directive-ddb-fields-transformer.js","sourceRoot":"","sources":["../../src/has-many/has-many-directive-ddb-fields-transformer.ts"],"names":[],"mappings":";;;AAAA,oFAAoE;AAOpE,qEAA6D;AAC7D,4CAAwD;AAExD,oCAAqH;AAQrH,MAAa,oCAAoC;IAAjD;QACE,WAAM,GAAG,sCAAW,CAAC;QAErB,YAAO,GAAG,CAAC,OAA8C,EAAE,MAAqC,EAAQ,EAAE;YACxG,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC3C,IAAA,yCAAiC,EAAC;gBAChC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;gBAChD,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,YAAY,EAAE,SAAS;gBACvB,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK;gBACtC,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,oBAAe,GAAG,CAAC,OAAsD,EAAE,MAAqC,EAAQ,EAAE;YACxH,MAAM,CAAC,gBAAgB,GAAG,IAAA,2BAAmB,EAAC,MAAM,EAAE,OAAqC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACjH,CAAC,CAAC;QAEF,sBAAiB,GAAG,CAAC,OAAmC,EAAE,MAAqC,EAAQ,EAAE;YACvG,IAAA,oCAAwB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC1C,MAAM,SAAS,GAAG,IAAA,gCAAY,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5C,SAAS,CAAC,4CAA4C,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1E,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,OAAmC,EAAE,MAAqC,EAAQ,EAAE;YAC9F,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAC;YAC1B,MAAM,CAAC,UAAU,GAAG,IAAA,sBAAc,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC;CAAA;AA5BD,oFA4BC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransformerContextProvider, TransformerPrepareStepContextProvider, TransformerTransformSchemaStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
|
2
|
+
import { DataSourceBasedDirectiveTransformer } from '../data-source-based-directive-transformer';
|
|
3
|
+
import { HasManyDirectiveConfiguration } from '../types';
|
|
4
|
+
export declare class HasManyDirectiveDDBReferencesTransformer implements DataSourceBasedDirectiveTransformer<HasManyDirectiveConfiguration> {
|
|
5
|
+
dbType: import("@aws-amplify/graphql-transformer-interfaces").ModelDataSourceStrategyDbType;
|
|
6
|
+
prepare: (context: TransformerPrepareStepContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
7
|
+
transformSchema: (context: TransformerTransformSchemaStepContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
8
|
+
generateResolvers: (context: TransformerContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
9
|
+
validate: (context: TransformerContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=has-many-directive-ddb-references-transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-many-directive-ddb-references-transformer.d.ts","sourceRoot":"","sources":["../../src/has-many/has-many-directive-ddb-references-transformer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,qCAAqC,EACrC,6CAA6C,EAC9C,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mCAAmC,EAAE,MAAM,4CAA4C,CAAC;AAOjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAiBzD,qBAAa,wCAAyC,YAAW,mCAAmC,CAAC,6BAA6B,CAAC;IACjI,MAAM,sFAAe;IAErB,OAAO,YAAa,qCAAqC,UAAU,6BAA6B,KAAG,IAAI,CAUrG;IAEF,eAAe,YAAa,6CAA6C,UAAU,6BAA6B,KAAG,IAAI,CAAO;IAE9H,iBAAiB,YAAa,0BAA0B,UAAU,6BAA6B,KAAG,IAAI,CAIpG;IAUF,QAAQ,YAAa,0BAA0B,UAAU,6BAA6B,KAAG,IAAI,CAoB3F;CACH"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasManyDirectiveDDBReferencesTransformer = void 0;
|
|
4
|
+
const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
|
|
5
|
+
const ddb_references_generator_1 = require("../resolver/ddb-references-generator");
|
|
6
|
+
const resolvers_1 = require("../resolvers");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
class HasManyDirectiveDDBReferencesTransformer {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.dbType = graphql_transformer_core_1.DDB_DB_TYPE;
|
|
11
|
+
this.prepare = (context, config) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const modelName = config.object.name.value;
|
|
14
|
+
(0, resolvers_1.setFieldMappingResolverReference)(context, (_b = (_a = config.relatedType) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.value, modelName, config.field.name.value, true);
|
|
15
|
+
(0, utils_1.registerHasManyForeignKeyMappings)({
|
|
16
|
+
transformParameters: context.transformParameters,
|
|
17
|
+
resourceHelper: context.resourceHelper,
|
|
18
|
+
thisTypeName: modelName,
|
|
19
|
+
thisFieldName: config.field.name.value,
|
|
20
|
+
relatedType: config.relatedType,
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
this.transformSchema = (context, config) => { };
|
|
24
|
+
this.generateResolvers = (context, config) => {
|
|
25
|
+
(0, resolvers_1.updateTableForReferencesConnection)(config, context);
|
|
26
|
+
(0, resolvers_1.updateRelatedModelMutationResolversForCompositeSortKeys)(config, context);
|
|
27
|
+
new ddb_references_generator_1.DDBRelationalReferencesResolverGenerator().makeHasManyGetItemsConnectionWithKeyResolver(config, context);
|
|
28
|
+
};
|
|
29
|
+
this.validate = (context, config) => {
|
|
30
|
+
if (config.indexName) {
|
|
31
|
+
const mappedObjectName = context.resourceHelper.getModelNameMapping(config.object.name.value);
|
|
32
|
+
throw new Error(`Invalid @hasMany directive on ${mappedObjectName}.${config.field.name.value} - indexName is not supported with DynamoDB references.`);
|
|
33
|
+
}
|
|
34
|
+
(0, utils_1.ensureReferencesArray)(config);
|
|
35
|
+
(0, utils_1.validateParentReferencesFields)(config, context);
|
|
36
|
+
(0, utils_1.validateReferencesRelationalFieldNullability)(config);
|
|
37
|
+
const objectName = config.object.name.value;
|
|
38
|
+
const fieldName = config.field.name.value;
|
|
39
|
+
config.referenceNodes = (0, utils_1.getReferencesNodes)(config, context);
|
|
40
|
+
(0, utils_1.validateReferencesBidirectionality)(config);
|
|
41
|
+
const overrideIndexName = (0, utils_1.getOverrideIndexName)(config);
|
|
42
|
+
if (overrideIndexName) {
|
|
43
|
+
config.indexName = overrideIndexName;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
config.indexName = `gsi-${objectName}.${fieldName}`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.HasManyDirectiveDDBReferencesTransformer = HasManyDirectiveDDBReferencesTransformer;
|
|
52
|
+
//# sourceMappingURL=has-many-directive-ddb-references-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-many-directive-ddb-references-transformer.js","sourceRoot":"","sources":["../../src/has-many/has-many-directive-ddb-references-transformer.ts"],"names":[],"mappings":";;;AAAA,oFAAoE;AAOpE,mFAAgG;AAChG,4CAIsB;AAEtB,oCAQkB;AAQlB,MAAa,wCAAwC;IAArD;QACE,WAAM,GAAG,sCAAW,CAAC;QAErB,YAAO,GAAG,CAAC,OAA8C,EAAE,MAAqC,EAAQ,EAAE;;YACxG,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC3C,IAAA,4CAAgC,EAAC,OAAO,EAAE,MAAA,MAAA,MAAM,CAAC,WAAW,0CAAE,IAAI,0CAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACrH,IAAA,yCAAiC,EAAC;gBAChC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;gBAChD,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,YAAY,EAAE,SAAS;gBACvB,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK;gBACtC,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,oBAAe,GAAG,CAAC,OAAsD,EAAE,MAAqC,EAAQ,EAAE,GAAE,CAAC,CAAC;QAE9H,sBAAiB,GAAG,CAAC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AC,CAAC;IACJ,CAAC;CAAA;AApDD,4FAoDC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransformerContextProvider, TransformerPrepareStepContextProvider, TransformerTransformSchemaStepContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
|
|
2
|
+
import { DataSourceBasedDirectiveTransformer } from '../data-source-based-directive-transformer';
|
|
3
|
+
import { HasManyDirectiveConfiguration } from '../types';
|
|
4
|
+
export declare class HasManyDirectiveSQLTransformer implements DataSourceBasedDirectiveTransformer<HasManyDirectiveConfiguration> {
|
|
5
|
+
dbType: import("@aws-amplify/graphql-transformer-interfaces").ModelDataSourceStrategySqlDbType;
|
|
6
|
+
prepare: (context: TransformerPrepareStepContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
7
|
+
transformSchema: (context: TransformerTransformSchemaStepContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
8
|
+
generateResolvers: (context: TransformerContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
9
|
+
validate: (context: TransformerContextProvider, config: HasManyDirectiveConfiguration) => void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=has-many-directive-sql-transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-many-directive-sql-transformer.d.ts","sourceRoot":"","sources":["../../src/has-many/has-many-directive-sql-transformer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAC1B,qCAAqC,EACrC,6CAA6C,EAC9C,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,mCAAmC,EAAE,MAAM,4CAA4C,CAAC;AAGjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAazD,qBAAa,8BAA+B,YAAW,mCAAmC,CAAC,6BAA6B,CAAC;IACvH,MAAM,yFAAqC;IAE3C,OAAO,YAAa,qCAAqC,UAAU,6BAA6B,KAAG,IAAI,CAGrG;IAEF,eAAe,YAAa,6CAA6C,UAAU,6BAA6B,KAAG,IAAI,CAErH;IAEF,iBAAiB,YAAa,0BAA0B,UAAU,6BAA6B,KAAG,IAAI,CAGpG;IAEF,QAAQ,YAAa,0BAA0B,UAAU,6BAA6B,KAAG,IAAI,CAK3F;CACH"}
|