@@ -388,7 +388,6 @@ export class CreateFactory {
388
388
create,
389
389
input,
390
390
callbackBucket,
391
- isNested,
392
391
relationship,
393
392
} ) ;
394
393
}
@@ -460,42 +459,40 @@ export class CreateFactory {
460
459
create,
461
460
input,
462
461
callbackBucket,
463
- isNested,
464
462
relationship,
465
463
} : {
466
464
entity : ConcreteEntityAdapter ;
467
465
create : CreateOperation ;
468
466
input : Record < string , any > ;
469
467
callbackBucket : CallbackBucket ;
470
- isNested : boolean ;
471
468
relationship ?: RelationshipAdapter ;
472
469
} ) {
473
- if ( ! isNested ) {
474
- entity . getPopulatedByFields ( "CREATE" ) . forEach ( ( attribute ) => {
475
- const attachedTo = "node" ;
476
- // the param value it's irrelevant as it will be overwritten by the callback function
477
- const callbackParam = new Cypher . Param ( "1234" ) ;
478
- const field = new ParamInputField ( {
479
- attribute,
480
- attachedTo,
481
- inputValue : callbackParam ,
482
- } ) ;
483
- create . addField ( field ) ;
470
+ entity . getPopulatedByFields ( "CREATE" ) . forEach ( ( attribute ) => {
471
+ const attachedTo = "node" ;
472
+ // the param value it's irrelevant as it will be overwritten by the callback function
473
+ const callbackParam = new Cypher . Param ( "1234" ) ;
474
+ const field = new ParamInputField ( {
475
+ attribute,
476
+ attachedTo,
477
+ inputValue : callbackParam ,
478
+ } ) ;
479
+ create . addField ( field ) ;
484
480
485
- const callbackFunctionName = attribute . annotations . populatedBy ?. callback ;
486
- if ( ! callbackFunctionName ) {
487
- throw new Error ( `PopulatedBy callback not found for attribute ${ attribute . name } ` ) ;
488
- }
481
+ const callbackFunctionName = attribute . annotations . populatedBy ?. callback ;
482
+ if ( ! callbackFunctionName ) {
483
+ throw new Error ( `PopulatedBy callback not found for attribute ${ attribute . name } ` ) ;
484
+ }
489
485
490
- callbackBucket . addCallback ( {
491
- functionName : callbackFunctionName ,
492
- param : callbackParam ,
493
- parent : input ,
494
- type : attribute . type ,
495
- } ) ;
486
+ callbackBucket . addCallback ( {
487
+ functionName : callbackFunctionName ,
488
+ param : callbackParam ,
489
+ parent : input ,
490
+ type : attribute . type ,
496
491
} ) ;
497
- } else {
498
- relationship ?. getPopulatedByFields ( "CREATE" ) . forEach ( ( attribute ) => {
492
+ } ) ;
493
+
494
+ if ( relationship ) {
495
+ relationship . getPopulatedByFields ( "CREATE" ) . forEach ( ( attribute ) => {
499
496
const attachedTo = "relationship" ;
500
497
// the param value it's irrelevant as it will be overwritten by the callback function
501
498
const relCallbackParam = new Cypher . Param ( "" ) ;
0 commit comments