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

Use prettier for GraphQL query prettification #2024

Closed
wants to merge 1 commit into from

Conversation

chasingmaxwell
Copy link

@chasingmaxwell chasingmaxwell commented Apr 2, 2020

This PR uses prettier to format GraphQL queries which addresses #2023.

There were some diffs in a couple package-lock.json files that seem to be related to my environment. Particularly the removal of "dev": true all over the place. I did some looking up on how to resolve this, but was having little luck. If this is undesirable, do you have any suggestions for what I can change locally to avoid it? I'm using nvm to manage the node version according to the .nvmrc file. Maybe npm version?

@gschier gschier self-requested a review April 3, 2020 18:02
Copy link
Contributor

@gschier gschier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I agree that having prettier be part of the app would be awesome, it's a huge dependency to be adding just to format a GraphQL query. Do you think there's a way to do this with the current graphql library?

@chasingmaxwell
Copy link
Author

I'll look into it a bit more. If not, I'm happy to go the plugin route.

@chasingmaxwell
Copy link
Author

There is not a way to do this currently with the graphql library. There is an issue to add pretty-printing and some related pull requests, but for now print is the only option and its primary function is not for prettifying. It looks like the recommended approach for now is to use prettier so a plugin is the way to go here.

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

Successfully merging this pull request may close these issues.

2 participants