Created
March 15, 2019 03:45
-
-
Save thelebster/ac2cbc74f674bc88f4bbdde4954c83a1 to your computer and use it in GitHub Desktop.
Allows to debug GraphQL queries with jQuery AJAX in Crome console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let query = ` | |
| query { | |
| someQuery { | |
| id | |
| title | |
| body | |
| } | |
| } | |
| `; | |
| let variables = { | |
| }; | |
| var settings = { | |
| "async": true, | |
| "crossDomain": true, | |
| "url": "https://example.com/graphql", | |
| "method": "POST", | |
| "headers": { | |
| "Content-Type": "application/json", | |
| "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NTI1ODEzNzMsImV4cCI6MTU1MjU4NDk3MywidWlkIjoiNzkiLCJkcnVwYWwiOnsidWlkIjoiNzkifX0.jAl7wRZi6fQr-45DQPMJocrc8xz_1ORQK97R0mb2alM", | |
| "cache-control": "no-cache" | |
| }, | |
| "data": JSON.stringify({query, variables}) | |
| } | |
| jQuery.ajax(settings).done(function (response) { | |
| console.log(response); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment