Inherit documentation on implementing types of interface #3249
Replies: 1 comment 1 reply
-
We would be guided by the graphql spec and it says nothing about description inheritance. So if you gave this schema to some other graphql engine - you could have no expectation that it did description inheritance. Also there can be multiple interfaces on an object type
which description should be used here? I think you would be better to use a It would be possible to do what you are discussing fairly easily and you get to decide how to resolve edge cases like multiple interfaces. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When designing a schema using interfaces, it's possible to find that documenting across the implementing types is a lot of work. Here's an example:
In the example above,
breed: String
is defined on the interfaceAnimal
which is implemented by three types. When inspectingbreed
onDog
in GraphiQL, there is no documentation because the developer has only documented theAnimal
. To see the comment, the end user must know that theAnimal
interface is documented, and navigate to the type to see the comment. We could save the developer and end-user some time by offering the ability to inherit the documentation comments, when there are no explicit comments on an implementing type.What do folks think? Does it make sense that when
Cat.breed
is not documented, to inherit the comments fromAnimal.breed
? Is this functionality desired in graphql-java? In this case, sinceCat.breed
has no comments, we could inherit the comment fromAnimal.breed
.Beta Was this translation helpful? Give feedback.
All reactions