-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
I know extendSchema is undocumented, but it's the only way to accomplish the schema extensions feature I recently added to my library, so I'm reporting this in case someone over there is making extendSchema legit. :)
I've got a query of which this is a part:
{
target {
... on URL {
resource
}
}
}The target field is of type Entity, which is an interface, and URL implements that interface. When I run this without using extendSchema, I get the expected result:
{
"target": {
"resource": "https://www.discogs.com/artist/408531"
}
}But when the schema has been run through extendSchema, I get a seemingly impossible result:
{
"target": {}
}This result is supposed to be impossible with GraphQL – you can't ever get an empty object. Either it's null, or has at least one field (which could be null).
When I log what's happening in the resolvers, the target resolver is receiving and returning all the correct data. But the URL field resolvers are never run. Somehow running the schema through extendSchema causes this.