232 |
{value.name}
233 |
239 | {value.deprecationReason && (
240 |
246 | diff --git a/src/components/GraphiQL.js b/src/components/GraphiQL.js
247 | index 38f9ca7..eaa87b8 100644
248 | --- a/src/components/GraphiQL.js
249 | +++ b/src/components/GraphiQL.js
250 | @@ -728,7 +728,10 @@ export class GraphiQL extends React.Component {
251 |
252 | handlePrettifyQuery = () => {
253 | const editor = this.getQueryEditor();
254 | - editor.setValue(print(parse(editor.getValue())));
255 | + editor.setValue(print(parse(editor.getValue()).replace(/^( +)/mg, "$1$1")));
256 | + const variables = JSON.stringify(JSON.parse(this.state.variables), null, 4);
257 | + const varEditor = this.variableEditorComponent.getCodeMirror();
258 | + varEditor.setValue(variables);
259 | };
260 |
261 | handleMergeQuery = () => {
262 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hapi-plugin-graphiql",
3 | "version": "2.3.0",
4 | "description": "HAPI plugin for GraphiQL integration",
5 | "keywords": [ "hapi", "plugin", "graphiql", "graphql" ],
6 | "main": "./hapi-plugin-graphiql.js",
7 | "license": "MIT",
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/rse/hapi-plugin-graphiql.git"
11 | },
12 | "author": {
13 | "name": "Dr. Ralf S. Engelschall",
14 | "email": "rse@engelschall.com",
15 | "url": "http://engelschall.com"
16 | },
17 | "homepage": "https://github.com/rse/hapi-plugin-graphiql",
18 | "bugs": "https://github.com/rse/hapi-plugin-graphiql/issues",
19 | "peerDependencies": {
20 | "@hapi/hapi": ">=18.0.0"
21 | },
22 | "dependencies": {
23 | "@hapi/boom": "7.4.2",
24 | "mz": "2.7.0",
25 | "bluebird": "3.5.5",
26 | "jquery": "3.4.1",
27 | "whatwg-fetch": "3.0.0",
28 | "react": "16.8.6",
29 | "react-dom": "16.8.6",
30 | "react-dom-factories": "1.0.2",
31 | "graphql": "14.3.1",
32 | "graphiql": "0.13.0",
33 | "nunjucks": "3.2.0"
34 | },
35 | "devDependencies": {
36 | "@hapi/hapi": "18.3.1",
37 | "babel-eslint": "10.0.1",
38 | "eslint": "5.16.0",
39 | "eslint-config-standard": "12.0.0",
40 | "eslint-plugin-standard": "4.0.0",
41 | "eslint-plugin-promise": "4.1.1",
42 | "eslint-plugin-import": "2.17.3",
43 | "eslint-plugin-node": "9.1.0"
44 | },
45 | "engines": {
46 | "node": ">=8.0.0"
47 | },
48 | "scripts": {
49 | "prepublishOnly": "eslint --config eslint.yaml hapi-plugin-graphiql.js"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rse/hapi-plugin-graphiql/1348120bc90961c62b228bf11f643e6f2d4a9eb5/screenshot.png
--------------------------------------------------------------------------------