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

Implemented Prettier for GraphQL formatting #4022

Merged
merged 3 commits into from
Oct 1, 2021
Merged

Implemented Prettier for GraphQL formatting #4022

merged 3 commits into from
Oct 1, 2021

Conversation

ariasmn
Copy link
Contributor

@ariasmn ariasmn commented Sep 11, 2021

Implementing a specific library for GraphQL formatting was needed to close some issues.
This should close #3242 , which links to three other issues related to GraphQL formatting.

Copy link
Contributor

@dimitropoulos dimitropoulos left a comment

Choose a reason for hiding this comment

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

fantastic!

I tested with

type Query {
  me: User
}

# comment that shouldn't go away
type User {
  id: ID
  name: String
}

mutation UpdateBasicInfo($id: ID!, $firstName: String, $middleName: String, $lastName: String, $gender: string, $birthDate: DateTime) {
  updateEmployee(employee: {id: $id, firstName: $firstName, middleName: $middleName, lastName: $lastName, gender: $gender, birthDate: $birthDate }) {
    id
    firstName
    middleName
    lastName
    gender
    birthDate
  }
}
BEFORE AFTER
Screenshot_20210923_123642 Screenshot_20210923_123524

So, comments are not removed, indent is respected (including tabs or not), and long lines wrap like you'd expect.

This is great. Thanks!!

@wdawson
Copy link
Contributor

wdawson commented Sep 23, 2021

Thanks for the PR @ariasmn ! Looking forward to getting this out to everyone 🚀

@ariasmn
Copy link
Contributor Author

ariasmn commented Sep 23, 2021

@dimitropoulos @wdawson Thank you so much for the feedback and the fantastic job you do! Glad that I could help 😄

Copy link
Contributor

@gatzjames gatzjames left a comment

Choose a reason for hiding this comment

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

🚀 LGTM! Works great!

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.

[umbrealla] use a true graphql prettifier (i.e., one designed for prettifying)
4 participants