Hi Team,
I created the schema and accompanying documentation, which works well when I just put all the predicates in their respective types. The documentation is properly presented by GraphQL Playground.
When I moved common predicates into a separate Interface, the documentation stops working.
I can recall from a talk by @mrjn, in YouTube video, the predicates are copied over to wherever they are implemented at runtime.
As it follows the principle of DRY, I have nothing against it. However, I am torn between having documentation and not repeating myself with interfaces.
e.g.
Before:
type Comment {
…
“”"
Tag NSFW if vulgar
Tag Spoiller if the content spoils a movie or a game
“”"
tag: [Tags!]
}
type Article {
…
“”"
Tag NSFW if vulgar
Tag Spoiller if the content spoils a movie or a game
“”"
tag: [Tags!]
}
After:
interface Post {
…
“”"
Tag NSFW if vulgar
Tag Spoiller if the content spoils a movie or a game
“”"
tag: [Tags!]
}
type Article implements Post {
}
type Comment implements Post {
}
Is there a workaround, to make the introspection work without repetition, or do I have to make peace with not having documentation for those specific predicates?
P.S. This only seems odd for scalar values, as composite values have their separate documentation.