`@with` directive fails to eager-load multiple nested relations on the same parent relation
I've come across what i think is a bug involving the use of multiple @with directives
Here is an example schema:
type User{
viewerSummary: ViewerSummary
@with(relation: "shows.producers")
@with(relation: "shows.actors")
@with(relation: "films.producers")
@with(relation: "films.actors")
@method(name: "getViewerSummary")
}
In the given example, after loading a user with viewerSummary, actors are eager-loaded but producers are not.
Expected behavior/Solution
I would expect both relationships (producers & actors) to be eager loaded
Lighthouse Version
v5.63
This issue was uncovered in https://github.com/nuwave/lighthouse/pull/1915 and has not been fixed yet, see https://github.com/nuwave/lighthouse/blob/26c25e9eadd0b5aecdd637a84354b82d93e2e9bd/tests/Integration/Schema/Directives/WithDirectiveTest.php#L306-L308.
https://github.com/nuwave/lighthouse/issues/1873 is related, it is probably a good idea to work on both issues at once.
Duplicate of https://github.com/nuwave/lighthouse/issues/1132.