-
-
Notifications
You must be signed in to change notification settings - Fork 464
Open
Labels
bugAn error within LighthouseAn error within Lighthouse
Description
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 | MagazineLighthouse 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
Metadata
Metadata
Assignees
Labels
bugAn error within LighthouseAn error within Lighthouse