How to see the Twitch web client GraphQL queries in plain text 🕵️ #1
stefansundin
started this conversation in
Show and tell
Replies: 1 comment
-
|
I made a simple Firefox browser extension that can disable |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If you're using the Twitch website in an attempt to reverse engineer their GraphQL queries then you've probably come across this problem where the queries are not actually sent over the wire, instead using the
persistedQueryfeature of Apollo where it just sends asha256Hashrepresentation of the query. 🕵️You can download the Twitch JavaScript code (e.g. https://static.twitchcdn.net/assets/core-316f2be68eeca87515ab.js) and search for
"queryto find some of the queries. But this isn't that convenient. (If someone has written something to process the source files to something more manageable, please speak up!)Another way is to disable the
persistedQueryfeature. The process I've come up with is a little bit cumbersome, so if someone has found a simpler way of doing this then please let me know. These instructions and screenshots are made using Firefox but other browsers should be capable of the same things but the buttons may differ.First, open the Debugger and locate the
core-[......].jsfile. Click the button to pretty-print the file (button looks like{}).Then search the code for this snippet:
Click the line number to activate a breakpoint on that line. The line number will have a blue thing put over it.
Once you've performed the actions above, it should look something like the following:
Now, reload the page and the breakpoint should activate almost immediately. You'll see this:
Switch to the Console tab and run the following:
Now continue the page execution by clicking the Play button. Any GraphQL queries made should now be in plain text and not use any of the
persistedQuerynonsense. This change is not persisted so if you reload the page it will go away. ThedynamicSettings.overridescode suggests that perhaps there is a way to store this override in a way so that it persists, but I have not been able to find how to do that yet.The requests should now look like this:
Much better! 👍
Feel free to share your own tips in the comments below!!
Beta Was this translation helpful? Give feedback.
All reactions