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

elegantly prettify input object in graphiql #1516

Closed
wawhal opened this issue Apr 29, 2020 · 3 comments
Closed

elegantly prettify input object in graphiql #1516

wawhal opened this issue Apr 29, 2020 · 3 comments

Comments

@wawhal
Copy link

wawhal commented Apr 29, 2020

The prettify button puts the input objects in single line. It would be nice if it gets prettified in a prettified JSON structure.

Current prettification:

query MyQuery {
  user(where: {id: {_eq: 10}}) {
    id
    name
    age
  }
}

Expected prettification:

query MyQuery {
  user (
    where: {
      id: {
        _eq: 10
      }
    }
  ) {
    id
    name
    age
  }
}
@wawhal wawhal changed the title prettify input object in graphiql elegantly prettify input object in graphiql Apr 29, 2020
@acao
Copy link
Member

acao commented Apr 29, 2020

hey thanks for reporting this! there have been many feature requests for these, so please chime in on one that is already open next time!

because prettier/standalone starts at about 500kb addition to the payload. the current size is 720kb. we are not using prettier currently, instead a much lighter and simpler method that has issues, worst of which is removing comments.

so my solution was to load it dynamically, which we are doing in the RFC here:
acao#17

so prettier configurations will be configurable in the language service, monaco mode and GraphiQL shortly, please help us review the in progress work!

if you'd like to see this merged, please help review and advance the plugin API effort: #983!

@acao acao closed this as completed Apr 29, 2020
@acao
Copy link
Member

acao commented Apr 29, 2020

let's move discussion to this proposal: #1517

if y'all are interested and don't mind pulling down that PR and try it out locally, you can give some feedback. it's essentially the same as it works in codesandbox, slightly similar to vscode except you can't configure formatters, there is only one

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

No branches or pull requests

3 participants