You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying a scope to the morphTo directive, it appears that Lighthouse is trying to apply the scope to the root model, rather than then target relationship. For instance, given the following schema:
Right, the current behaviour is somewhat nonsensical. To properly support scopes on polymorphic relations, the definition has to take the type of the related model into account. I got a PR on this going, but it needs a bunch more work to be finished. @dennis-koster please review #2110
@spawnia Hi Spawnia, thanks for drafting up a PR! I think the idea of specifying which model you want to apply what scope(s) to makes sense. I wonder if this would work in combination with the union type though, as in my example. Perhaps it would be beneficial to add a test for that scenario as well.
Describe the bug
When applying a scope to the
morphTo
directive, it appears that Lighthouse is trying to apply the scope to the root model, rather than then target relationship. For instance, given the following schema:Lighthouse is trying to apply the
active
scope to thePublication
model, rather than theMagazine
orBook
model.Expected behavior/Solution
The scope should be applied to the query responsible for fetching the
Magazine
orBook
.Steps to reproduce
See above example.
Lighthouse Version
v5.23.1
The text was updated successfully, but these errors were encountered: