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

feat(#2265): Support GraphQL variables formatting #2267

Merged

Conversation

Eynorey
Copy link
Contributor

@Eynorey Eynorey commented May 8, 2024

Description

Inspired by #526 and its follow-ups, this PR adds support for formatting code on the GraphQL Variables tab.

It equips the CodeEditor component with formatting capabilities (using prettier) and a button that's only rendered if consumers provide the formattingOptions prop, where an appropriate parser and potential prettier plugins can be specified.

This way the formatter can be re-used in other places down the line as described in #2265.

2024-05-08_12-30-12

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

@mjhcorporate
Copy link
Contributor

Looks great!

Copy link
Contributor

@mheidinger mheidinger left a comment

Choose a reason for hiding this comment

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

Literally 2 hours ago I thought: Oh that would be a nice thing to have, maybe I can contribute that!

@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 2, 2024
@pull-request-size pull-request-size bot added size/M and removed size/L labels Sep 2, 2024
Copy link
Contributor Author

@Eynorey Eynorey left a comment

Choose a reason for hiding this comment

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

Thank you for updating this PR! :)

@helloanoop helloanoop merged commit 4bd31fb into usebruno:main Sep 4, 2024
2 checks passed
@helloanoop
Copy link
Contributor

Merged!
Thanks for working on this @Eynorey !

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

Successfully merging this pull request may close these issues.

6 participants