File tree Expand file tree Collapse file tree 6 files changed +63
-247
lines changed
examples/graphiql-webpack Expand file tree Collapse file tree 6 files changed +63
-247
lines changed Original file line number Diff line number Diff line change 9
9
"start" : " webpack serve"
10
10
},
11
11
"dependencies" : {
12
- "express" : " ^4.17.1" ,
13
- "express-graphql" : " ^0.9.0" ,
14
12
"graphiql" : " file:../../packages/graphiql" ,
15
13
"graphql" : " 14.5.8" ,
16
14
"react" : " 16.12.0"
19
17
"@babel/plugin-proposal-class-properties" : " 7.7.4" ,
20
18
"@babel/plugin-syntax-dynamic-import" : " 7.7.4" ,
21
19
"@babel/preset-env" : " 7.7.7" ,
22
- "@babel/preset-react" : " 7.7.0 " ,
20
+ "@babel/preset-react" : " 7.7.4 " ,
23
21
"babel-loader" : " ^8.0.6" ,
24
22
"css-loader" : " 3.4.0" ,
25
23
"html-webpack-plugin" : " ^3.2.0" ,
26
- "react-dom" : " ^16.11 .0" ,
27
- "style-loader" : " ^1.0.0 " ,
28
- "webpack" : " ^ 4.41.0 " ,
29
- "webpack-cli" : " ^3.3.9 " ,
30
- "webpack-dev-server" : " ^3.9.0 "
24
+ "react-dom" : " ^16.12 .0" ,
25
+ "style-loader" : " ^1.1.2 " ,
26
+ "webpack" : " 4.41.4 " ,
27
+ "webpack-cli" : " ^3.3.10 " ,
28
+ "webpack-dev-server" : " ^3.10.1 "
31
29
}
32
30
}
Original file line number Diff line number Diff line change 35
35
"build-flow" : " node ../../resources/buildFlow.js" ,
36
36
"build-demo" : " build-storybook -o ./storybook" ,
37
37
"check" : " flow check" ,
38
- "dev" : " cross-env NODE_ENV=development node test/ dev-server.js" ,
38
+ "dev" : " cross-env NODE_ENV=development webpack- dev-server --config resources/webpack.config .js" ,
39
39
"cypress-open" : " yarn e2e-server 'cypress open'" ,
40
40
"e2e" : " yarn e2e-server 'cypress run'" ,
41
41
"e2e-server" : " start-server-and-test 'cross-env PORT=8080 node test/e2e-server' 'http-get://localhost:8080/graphql?query={test { id }}'" ,
66
66
"cssnano" : " ^4.1.10" ,
67
67
"enzyme" : " ^3.10.0" ,
68
68
"enzyme-adapter-react-16" : " ^1.15.1" ,
69
- "express" : " 5.0.0-alpha.5 " ,
69
+ "express" : " 4.17.1 " ,
70
70
"express-graphql" : " 0.9.0" ,
71
71
"graphql" : " 14.5.8" ,
72
72
"html-webpack-plugin" : " ^3.2.0" ,
86
86
"serve" : " ^11.2.0" ,
87
87
"start-server-and-test" : " ^1.10.6" ,
88
88
"style-loader" : " ^1.0.0" ,
89
+ "webpack" : " 4.41.4" ,
89
90
"webpack-bundle-analyzer" : " ^3.6.0" ,
90
- "webpack-cli" : " ^3.3.10"
91
+ "webpack-cli" : " ^3.3.10" ,
92
+ "webpack-dev-server" : " ^3.10.1"
91
93
}
92
94
}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ const resultConfig = {
34
34
// bypass simple localhost CORS restrictions by setting
35
35
// these to 127.0.0.1 in /etc/hosts
36
36
allowedHosts : [ 'local.example.com' , 'graphiql.com' ] ,
37
+ before : require ( '../test/beforeDevServer' ) ,
37
38
} ,
38
39
node : {
39
40
fs : 'empty' ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright (c) 2019 GraphQL Contributors.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ const express = require ( 'express' ) ;
9
+ const path = require ( 'path' ) ;
10
+ const graphqlHTTP = require ( 'express-graphql' ) ;
11
+ const schema = require ( './schema' ) ;
12
+
13
+ module . exports = function beforeDevServer ( app , _server , _compiler ) {
14
+ // GraphQL Server
15
+ app . post ( '/graphql' , graphqlHTTP ( { schema } ) ) ;
16
+
17
+ app . get (
18
+ '/graphql' ,
19
+ graphqlHTTP ( {
20
+ schema,
21
+ } ) ,
22
+ ) ;
23
+
24
+ app . use ( '/images' , express . static ( path . join ( __dirname , 'images' ) ) ) ;
25
+
26
+ app . use (
27
+ '/renderExample.js' ,
28
+ express . static ( path . join ( __dirname , '../resources/renderExample.js' ) ) ,
29
+ ) ;
30
+ } ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments