File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
spring-graphql/src/main/resources/graphiql Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 18
18
< script src ="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js " crossorigin > </ script >
19
19
< script src ="https://unpkg.com/graphiql/graphiql.min.js " type ="application/javascript "> </ script >
20
20
< link rel ="stylesheet " href ="https://unpkg.com/graphiql/graphiql.min.css " />
21
+ < script src ="https://unpkg.com/@graphiql/plugin-explorer/dist/index.umd.js " crossorigin > </ script >
22
+ < link rel ="stylesheet " href ="https://unpkg.com/@graphiql/plugin-explorer/dist/style.css "/>
21
23
</ head >
22
24
< body >
23
25
< div id ="graphiql "> Loading...</ div >
24
26
< script >
25
27
const params = new URLSearchParams ( window . location . search ) ;
26
-
27
28
const path = params . get ( "path" ) || "/graphql" ;
28
29
const url = `${ location . protocol } //${ location . host } ${ path } ` ;
29
-
30
30
const wsPath = params . get ( "wsPath" ) || "/graphql" ;
31
31
const wsProtocol = location . protocol === 'https:' ? 'wss:' : 'ws:' ;
32
32
const subscriptionUrl = `${ wsProtocol } //${ location . host } ${ wsPath } ` ;
36
36
subscriptionUrl,
37
37
} ) ;
38
38
39
+ const explorerPlugin = GraphiQLPluginExplorer . explorerPlugin ( ) ;
39
40
ReactDOM . render (
40
41
React . createElement ( GraphiQL , {
41
42
fetcher : gqlFetcher ,
42
43
defaultVariableEditorOpen : true ,
43
44
headerEditorEnabled : true ,
44
- shouldPersistHeaders : true
45
+ shouldPersistHeaders : true ,
46
+ plugins : [ explorerPlugin ]
45
47
} ) ,
46
48
document . getElementById ( 'graphiql' ) ,
47
49
) ;
You can’t perform that action at this time.
0 commit comments