[GH-ISSUE #990] Enhancement: prettify GraphQL query in request Treeview (even slightly). #983

Open
opened 2026-03-03 19:23:32 +03:00 by kerem · 4 comments
Owner

Originally created by @Bertrand on GitHub (Sep 10, 2021).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/990

Originally assigned to: @NghiaTranUIT on GitHub.

Today, it's very hard to read the query part in a GraphQL request :

image

This is because the whole query (which can be HUGE) is displayed as a single line.

Would it be possible to a add a prettify selector that would display the query part in a more readable format in Treeview?

I know a full-fledged query formatter is a lot of work.

But at first, simply replacing the \n characters with real carriage returns would be a HUGE improvement for us working on GraphQL projects.

Originally created by @Bertrand on GitHub (Sep 10, 2021). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/990 Originally assigned to: @NghiaTranUIT on GitHub. Today, it's very hard to read the `query` part in a GraphQL request : <img width="805" alt="image" src="https://user-images.githubusercontent.com/4960/132844930-da474dc6-142d-4935-a295-e233872c9847.png"> This is because the whole query (which can be HUGE) is displayed as a single line. Would it be possible to a add a `prettify` selector that would display the query part in a more readable format in Treeview? I know a full-fledged query formatter is a lot of work. **But at first, simply replacing the `\n` characters with real carriage returns would be a _HUGE_ improvement for us working on GraphQL projects.**
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 10, 2021):

I tried on different GraphQL Query, some of them doesn't have \n, so it's really difficult to manually prettify it.

I suppose that I will implement a GraphQL Query Prettifier, which is similar to the below GraphQL online tool 👍

Since the TreeView is an NSOutlieView (support tree-level-hierachie), and it seems that it's difficult to support multiple lines, so I'd introduce a GraphQL Tab

Screen Shot 2021-09-10 at 19 45 10
<!-- gh-comment-id:916879239 --> @NghiaTranUIT commented on GitHub (Sep 10, 2021): I tried on different GraphQL Query, some of them doesn't have `\n`, so it's really difficult to manually prettify it. I suppose that I will implement a GraphQL Query Prettifier, which is similar to the below GraphQL online tool 👍 Since the TreeView is an NSOutlieView (support tree-level-hierachie), and it seems that it's difficult to support multiple lines, so I'd introduce a GraphQL Tab <img width="1900" alt="Screen Shot 2021-09-10 at 19 45 10" src="https://user-images.githubusercontent.com/5878421/132855291-9a481105-5b21-4ba2-9400-c1901776612e.png">
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 11, 2021):

Hey @Bertrand Let check this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.32.1_GraphQL_Prettier.dmg

You can open a GraphQL Tab and it will prettify the GraphQL's query value 👍

To open GraphQL tab, please click on the + button on request bar -> It will open Custom Previewer Window -> Select GraphQL 🙌

Screen_Shot_2021-09-11_at_16_04_21 Screen Shot 2021-09-11 at 15 58 11 Screen Shot 2021-09-11 at 15 58 08
<!-- gh-comment-id:917372058 --> @NghiaTranUIT commented on GitHub (Sep 11, 2021): Hey @Bertrand Let check this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_2.32.1_GraphQL_Prettier.dmg You can open a GraphQL Tab and it will prettify the GraphQL's query value 👍 To open GraphQL tab, please click on the + button on request bar -> It will open Custom Previewer Window -> Select GraphQL 🙌 <img width="612" alt="Screen_Shot_2021-09-11_at_16_04_21" src="https://user-images.githubusercontent.com/5878421/132942608-bcb10a2d-c64e-466d-bf6f-62064e499790.png"> <img width="1904" alt="Screen Shot 2021-09-11 at 15 58 11" src="https://user-images.githubusercontent.com/5878421/132942473-f9bfcd3c-658b-42ef-9931-4ec3db9ed1fd.png"> <img width="1904" alt="Screen Shot 2021-09-11 at 15 58 08" src="https://user-images.githubusercontent.com/5878421/132942485-1a362f7f-fc55-4fe5-a921-80755714e7c7.png">
Author
Owner

@Bertrand commented on GitHub (Sep 13, 2021):

Wow 😄
This is such a game-changer !

Many many thanks @NghiaTranUIT

A few remarks:

  • you might want to add an additional pane holding the variables, so users don't have to switch back and forth between the GrapqhQL and the json pane.
  • There are strange coloring applied to some of the parameters, and even some of the fields:
image
<!-- gh-comment-id:917928461 --> @Bertrand commented on GitHub (Sep 13, 2021): Wow 😄 This is such a game-changer ! Many many thanks @NghiaTranUIT A few remarks: - you might want to add an additional pane holding the variables, so users don't have to switch back and forth between the GrapqhQL and the json pane. - There are strange coloring applied to some of the parameters, and even some of the fields: <img width="536" alt="image" src="https://user-images.githubusercontent.com/4960/133044034-7e4f5e20-e66a-48d8-8583-5ae6c9251a47.png">
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 13, 2021):

Sorry for the syntax highlight for graphQL. I tried to support CodeMirror-graphQL-mode but it doesn't work well 😿

you might want to add an additional pane holding the variables, so users don't have to switch back and forth between the GrapqhQL and the json pane.

Thanks for your proposal. I will find a way to support it 👍

<!-- gh-comment-id:917929730 --> @NghiaTranUIT commented on GitHub (Sep 13, 2021): Sorry for the syntax highlight for graphQL. I tried to support CodeMirror-graphQL-mode but it doesn't work well 😿 > you might want to add an additional pane holding the variables, so users don't have to switch back and forth between the GrapqhQL and the json pane. Thanks for your proposal. I will find a way to support it 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#983
No description provided.