Closed
Description
Describe the bug
@InterfaceType
abstract class Animal {
@Field(() => String, { name: "animalName" })
abstract getAnimalName: () => Promise<string>;
}
@ObjectType({ implements: [Animal] })
export class Dog {
async getAnimalName() { return "Fido"; }
/* ... */
}
The generated schema is along the lines of
interface Animal {
animalName: String!
}
but if you try to query, you get a GraphQL error along the lines of
Error: Cannot return null for non-nullable field Dog.animalName
seemingly because the mapping from animalName
to getAnimalName
hasn't happened.
Addendum:
I see that name
isn't supported in some other places (#263) but this doesn't seem like the same situation.