The code above intercepts calls to /graphql and uses the incoming json data to construct a link to the GraphiQL editor. You could output the GraphiQL link directly to the terminal, but that will be quite noisy, especially if you’re dealing with complex queries with several variables. Thus we hash the query and give ourselves nice shortlinks.

Here’s a screenshot of the server.js code running in my terminal.

Nice clickable links that take you directly to a pre-filled GraphiQL editor.

In most terminals (and hopefully yours) you can click these links, and you’ll get sent to you GraphiQL editor pre-filled with the query and any accompanying variables.

Huzzah! Those contorted GraphQL queries and obscure input variables
will hound you no more. Now you can quickly debug them.