graphql-kit / graphql-voyager

🛰️ Represent any GraphQL API as an interactive graph
https://graphql-kit.com/graphql-voyager/
MIT License
7.74k stars 511 forks source link

How do I add custom metadata to the documentation pane #117

Open mypark opened 5 years ago

mypark commented 5 years ago

It would be great if we can add custom metadata to the documentation. How would I add custom metadata to the graphql schema so that it could show up in the documentation pane?

For example, I might want to decorate a field or entity with information saying that it requires authentication, or that is Personally Identifiable Information. Maybe I want to document a data owner or a data steward, etc...

I saw that there were a few projects that deal with custom decorators in the graphql schema:

but I'm looking for guidance on which direction to go if adding support for custom metadata to this project.

IvanGoncharov commented 5 years ago

@mypark Sadly GraphQL introspection mechanism doesn't support exposing custom metadata ATM. As you correctly pointed out it out GraphQL support custom directives but they aren't exposed by the server. But I'm working on a proposal that will add this possibility to the GraphQL specification.

mypark commented 5 years ago

Would your proposal be similar to the one the Apollo team is suggesting wit the + decorator?