GraphQL
Capture GraphQL HTTP Request with Proxyman
Last updated
Capture GraphQL HTTP Request with Proxyman
Last updated
From Proxyman 2.27.0, we can use debugging tools with GraphQL Requests by specifying the GraphQL Query Name.
Matching by GraphQL QueryName works with Breakpoint, Map Local, Map Remote, Block List, Allow List, and the Scripting Tool.
Open the debugging tool (e.g. Breakpoint)
Create new Rule
Click on Use "Wildcard Dropdown" -> Advanced -> Check GraphQL QueryName.
Enter the GraphQL QueryName
By doing this way, the debugging tool will match the original matching rule firstly, then match the GraphQL QueryName.
From build 3.0.0, Proxyman automatically fills the GraphQL Query Name when we create a debugging tool rule.
From Proxyman 2.33.0, Proxyman can prettify/beautify GraphQL's Query Value. To do it, please open Tools Menu -> Custom Previewer Tab -> Check GraphQL checkbox.
It's possible to extract and display the Query Name. Please Right-click on the Column Header and enable it.
GraphQL uses the same URL to query different responses from the server, current debugging tools (e.g. Map Local, Breakpoint, Map Remote) doesn't work well.
However, by using the Scripting Tool, we can easily achieve:
Map Local for the response depends on QueryName
Manipulate the query, body, header for GraphQL Requests and Response
We can use the Scripting tool to map
Open Proxyman
Enable SSL Proxying on the GraphQL domain
Verify that you can see HTTPS requests from your domain
Right-Click on the flow -> Tool -> Scripting to create a script with the given URL
To import a local file: Click the More button -> Import JSON or Other files -> Then selecting your file
Use the following script shows you how to set a Local File to a GraphQL request with QueryName="user"
Use the same code and change the queryName
Please use the snipped code to change the values