BoD
BoD

Reputation: 11045

In a GraphQL schema documentation comment, how do you link to a type?

Comments in GraphQL schema are in Markdown, so you can put links in them. I'd like a link in the comment for a type to point to another type, so readers of the documentation can browse from one type to the other.

For instance, I've tried this:

"""
A written or printed work consisting of pages glued or sewn together along one side and bound in covers.
A book has an [Author](Author).
"""
type Book {
    id: ID
    name: String
    author: Author
}

In GraphiQL, this was correctly translated to a link but the destination was wrong.

I'm afraid this is not really possible, but I figured I'd ask anyway! :)

Upvotes: 6

Views: 1607

Answers (1)

Daniel Rearden
Daniel Rearden

Reputation: 84807

If you generate your documentation statically, you could probably include relative links that would work in that context. However, GraphiQL doesn't currently support deep linking to a specific type, so there's no way to make that work.

Upvotes: 2

Related Questions