Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[graphiql] Don't render newlines in documentation strings #3155

Open
leonardehrenfried opened this issue Apr 27, 2023 · 1 comment
Open

[graphiql] Don't render newlines in documentation strings #3155

leonardehrenfried opened this issue Apr 27, 2023 · 1 comment

Comments

@leonardehrenfried
Copy link

leonardehrenfried commented Apr 27, 2023

Long documentation strings that contain a newline are rendered as is in GraphiQL. This makes reading them a bit confusing and disjointed.

Doc pane

Screenshot from 2023-04-27 12-39-23

Tooltip

Screenshot from 2023-04-27 12-31-46

In the original schema this looks like this:

    """
    Bearing, in degrees, clockwise from North, i.e., 0 is North and 90 is East. This can be the
    compass bearing, or the direction towards the next stop or intermediate location.
    """
    heading: Float

I would love it if these doc strings, which in our case can be multiple paragraphs, be treated like markdown. This would mean that a single newline is ignored and a double newline treated as a new paragraph.

Thank you for making this wonderful piece of software.

@acao
Copy link
Member

acao commented May 4, 2023

thanks @leonardehrenfried ! this is a great suggestion. packages/graphiql-react/src/markdown.ts is where we keep the configuration for markdown-it, and iirc, this is just a simple config tweak or plugin away from happening!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants