@kiwano/core 0.1.0 → 0.1.1
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.
|
@@ -19,9 +19,10 @@ class CreateInputObjectTypeBuilder extends inputObjectType_1.InputObjectTypeBuil
|
|
|
19
19
|
await super.finalizeInputObjectType(context, info);
|
|
20
20
|
const entity = this._entityObjectType instanceof objectType_1.ObjectTypeBuilder ? this._entityObjectType : this._entityObjectType();
|
|
21
21
|
const entityInfo = entity.info();
|
|
22
|
+
const existingFieldNames = info.fields.map(field => field.name);
|
|
22
23
|
for (let field of entityInfo.fields) {
|
|
23
24
|
const fieldInfo = field.info();
|
|
24
|
-
if (this._exclude.has(fieldInfo.name) || !(0, util_1.isTypeInput)(fieldInfo.type, context.rootSchema) || (0, util_1.isFieldId)(fieldInfo)) {
|
|
25
|
+
if (this._exclude.has(fieldInfo.name) || !(0, util_1.isTypeInput)(fieldInfo.type, context.rootSchema) || (0, util_1.isFieldId)(fieldInfo) || existingFieldNames.indexOf(fieldInfo.name) >= 0) {
|
|
25
26
|
continue;
|
|
26
27
|
}
|
|
27
28
|
const inputField = new inputField_1.InputFieldBuilder(fieldInfo.name, fieldInfo.type);
|
|
@@ -19,9 +19,10 @@ class UpdateInputObjectTypeBuilder extends inputObjectType_1.InputObjectTypeBuil
|
|
|
19
19
|
await super.finalizeInputObjectType(context, info);
|
|
20
20
|
const entity = this._entityObjectType instanceof objectType_1.ObjectTypeBuilder ? this._entityObjectType : this._entityObjectType();
|
|
21
21
|
const entityInfo = entity.info();
|
|
22
|
+
const existingFieldNames = info.fields.map(field => field.name);
|
|
22
23
|
for (let field of entityInfo.fields) {
|
|
23
24
|
const fieldInfo = field.info();
|
|
24
|
-
if (this._exclude.has(fieldInfo.name) || !(0, util_1.isTypeInput)(fieldInfo.type, context.rootSchema)) {
|
|
25
|
+
if (this._exclude.has(fieldInfo.name) || !(0, util_1.isTypeInput)(fieldInfo.type, context.rootSchema) || existingFieldNames.indexOf(fieldInfo.name) >= 0) {
|
|
25
26
|
continue;
|
|
26
27
|
}
|
|
27
28
|
const inputField = new inputField_1.InputFieldBuilder(fieldInfo.name, fieldInfo.type);
|