Skip to content

Commit 581d71a

Browse files
committed
Upgrading graphiql and voyager.
1 parent 5fa1fd0 commit 581d71a

19 files changed

+2381
-856
lines changed

assets/explorer/dist/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/explorer/dist/graphiql.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
-webkit-box-flex: 1;
4444
-ms-flex: 1;
4545
flex: 1;
46+
overflow-x: hidden;
4647
}
4748

4849
.graphiql-container .title {
@@ -83,6 +84,7 @@
8384
-ms-flex: 1;
8485
flex: 1;
8586
height: 34px;
87+
overflow-y: visible;
8688
padding: 7px 14px 6px;
8789
-webkit-user-select: none;
8890
-moz-user-select: none;
@@ -760,7 +762,7 @@ div.CodeMirror-lint-tooltip > * + * {
760762

761763
/* CURSOR */
762764

763-
.CodeMirror div.CodeMirror-cursor {
765+
.CodeMirror .CodeMirror-cursor {
764766
border-left: 1px solid black;
765767
}
766768
/* Shown when moving in bi-directional text */
@@ -1230,7 +1232,6 @@ span.CodeMirror-selectedtext { background: none; }
12301232
margin-left: 5px;
12311233
overflow: hidden;
12321234
text-overflow: ellipsis;
1233-
white-space: nowrap;
12341235
}
12351236

12361237
.graphiql-container .enum-value {
@@ -1258,7 +1259,7 @@ span.CodeMirror-selectedtext { background: none; }
12581259
}
12591260

12601261
.graphiql-container .arg-default-value {
1261-
color: #0B7FC7;
1262+
color: #43A047;
12621263
}
12631264

12641265
.graphiql-container .doc-deprecation {

assets/explorer/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
"lint": "eslint src"
77
},
88
"dependencies": {
9-
"graphiql": "^0.11.2",
10-
"graphql": "^0.10.3",
11-
"react": "^15.6.1",
12-
"react-dom": "^15.6.1"
9+
"graphiql": "^0.11.10",
10+
"graphql": "^0.11.7",
11+
"react": "^16.0.0",
12+
"react-dom": "^16.0.0"
1313
},
1414
"devDependencies": {
1515
"babel": "^6.23.0",
16-
"babel-core": "^6.25.0",
17-
"babel-eslint": "^7.2.3",
18-
"babel-loader": "^7.1.1",
16+
"babel-core": "^6.26.0",
17+
"babel-eslint": "^8.0.2",
18+
"babel-loader": "^7.1.2",
1919
"babel-preset-es2015": "^6.24.1",
2020
"babel-preset-react": "^6.24.1",
2121
"babel-preset-stage-0": "^6.24.1",
22-
"copy-webpack-plugin": "^4.0.1",
23-
"eslint": "^4.2.0",
24-
"eslint-config-airbnb": "^15.0.2",
25-
"eslint-plugin-import": "^2.7.0",
26-
"rimraf": "^2.6.1",
27-
"webpack": "^3.1.0"
22+
"copy-webpack-plugin": "^4.2.0",
23+
"eslint": "^4.10.0",
24+
"eslint-config-airbnb": "^16.1.0",
25+
"eslint-plugin-import": "^2.8.0",
26+
"rimraf": "^2.6.2",
27+
"webpack": "^3.8.1"
2828
}
2929
}
File renamed without changes.

assets/explorer/src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom';
33
import Drupal from 'drupal';
44
import jQuery from 'jquery';
55
import GraphiQL from 'graphiql';
6+
import { buildClientSchema } from 'graphql';
67

78
/**
89
* Behavior for rendering the GraphiQL interface.
@@ -15,6 +16,9 @@ Drupal.behaviors.graphQLRenderExplorer = {
1516
return;
1617
}
1718

19+
// Build a schema from the passed introspection data.
20+
const graphQLSchema = buildClientSchema(settings.graphqlIntrospectionData.data);
21+
1822
// Defines a GraphQL fetcher using the fetch API.
1923
const graphQLFetcher = (graphQLParams) => fetch(settings.graphqlRequestUrl, {
2024
method: 'post',
@@ -29,6 +33,7 @@ Drupal.behaviors.graphQLRenderExplorer = {
2933
ReactDOM.render(
3034
React.createElement(GraphiQL, {
3135
fetcher: graphQLFetcher,
36+
schema: graphQLSchema,
3237
}), container
3338
);
3439
},

assets/explorer/webpack.config.babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
}),
3333
new CopyWebpackPlugin([
3434
{ from: path.resolve(__dirname, 'node_modules/graphiql/graphiql.css') },
35-
{ from: path.resolve(__dirname, 'src/explorer.css') },
35+
{ from: path.resolve(__dirname, 'src/container.css') },
3636
]),
3737
]).concat(process.env.NODE_ENV === 'production' ? [
3838
new webpack.optimize.UglifyJsPlugin({

0 commit comments

Comments
 (0)