fix(graphql): nested collection for mongo#6174
Conversation
fcce827 to
206a83b
Compare
|
@soyuka I am done now with the changes you requested. The failing unit tests are not due to my changes (some deprecation notice). From my perspective this PR could be merged. |
| public function getNestedCollection(): Collection | ||
| { | ||
| return $this->nestedCollection; | ||
| return $this->nestedCollection->map(fn ($entry) => ['name' => $entry->name]); |
There was a problem hiding this comment.
I'm not fond of this why is this necessary?
There was a problem hiding this comment.
this mapping function was neccessary because mongo ODM behaves different like ORM does. The ORM Entity provides a Collection with each entry being an associative array. The ODM Document on the other hand provides a Collection with each entry being an instance of MultiRelationsNested / MultiRelationsNestedPaginated. So my intention here was to align the Testables here to get the same results.
Without this mapper the case for MultiRelationsNestedPaginated gets broken in test. If this is not acceptable for you, you may undo this mapping and find another way - I was not able to.
|
If you can add a documentation for that feature it'd be awesome, thanks! |
#6038 was introduced but we had mongodb tests disabled. Though the new scenario has been disabled temporarily for mongo. I activated it again and updated the mongo test fixtures to represent the same case as the ORM ones do.