lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Eager load multiple nested relations using @with

Open spawnia opened this issue 1 year ago • 3 comments

Resolves https://github.com/nuwave/lighthouse/issues/1132, probably also https://github.com/nuwave/lighthouse/issues/1873

  • [x] Added or updated tests
  • [x] Documented user facing changes
  • [ ] Updated CHANGELOG.md

Changes

Breaking changes

spawnia avatar Mar 14 '24 08:03 spawnia

In this exactly old version 5.70.3, the nested relationship eager loading works . But not on latest state version 6.x.

type Bar { 
      city: City  @method(name: "handleCity") @with(relation: "city.state")
}

robsontenorio avatar Jun 13 '24 20:06 robsontenorio

By the way , I have tested this PR and works fine, solve the problem. If you need some help to merge it let me know.

robsontenorio avatar Jun 13 '24 22:06 robsontenorio

By the way , I have tested this PR and works fine, solve the problem. If you need some help to merge it let me know.

The changes I made fix eager loading of multiple @with, but break other scenarios - see https://github.com/nuwave/lighthouse/actions/runs/9380728096/job/25828392738. Thus, it can not be merged as is, the final solution will have to look different.

spawnia avatar Jun 14 '24 07:06 spawnia