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:
type Author {
id: ID!
publications: [Publication!]!
}
type Publication {
id: ID!
publication: Publishable @morphTo(scopes: ["active"])
}
type Magazine {
id: ID!
title: String!
isActive: Boolean!
}
type Book {
id: ID!
title: String!
isActive: Boolean!
}
union Publishable = Book | Magazine
Lighthouse is trying to apply the active scope to the Publication model, rather than the Magazine or Book model.
Expected behavior/Solution
The scope should be applied to the query responsible for fetching the Magazine or Book.
Steps to reproduce
See above example.
Lighthouse Version
v5.23.1
Describe the bug
When applying a scope to the
morphTodirective, 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
activescope to thePublicationmodel, rather than theMagazineorBookmodel.Expected behavior/Solution
The scope should be applied to the query responsible for fetching the
MagazineorBook.Steps to reproduce
See above example.
Lighthouse Version
v5.23.1