File tree Expand file tree Collapse file tree 8 files changed +60
-1
lines changed
graphql-jpa-query-graphiql
java/com/introproventures/graphql/jpa/query/graphiql
test/java/com/introproventures/graphql/jpa/query/graphiql Expand file tree Collapse file tree 8 files changed +60
-1
lines changed Original file line number Diff line number Diff line change 2
2
<modelVersion >4.0.0</modelVersion >
3
3
<parent >
4
4
<groupId >com.introproventures</groupId >
5
- <artifactId >graphql-jpa-query</artifactId >
5
+ <artifactId >graphql-jpa-query-build </artifactId >
6
6
<version >0.4.3-SNAPSHOT</version >
7
+ <relativePath >../graphql-jpa-query-build</relativePath >
7
8
</parent >
8
9
<artifactId >graphql-jpa-query-graphiql</artifactId >
10
+
11
+ <dependencies >
12
+ <dependency >
13
+ <groupId >org.springframework.boot</groupId >
14
+ <artifactId >spring-boot-starter-web</artifactId >
15
+ <optional >true</optional >
16
+ </dependency >
17
+ </dependencies >
18
+
9
19
</project >
Original file line number Diff line number Diff line change
1
+ package com .introproventures .graphql .jpa .query .graphiql ;
2
+
3
+ import org .springframework .boot .autoconfigure .condition .ConditionalOnWebApplication ;
4
+ import org .springframework .context .annotation .Bean ;
5
+ import org .springframework .context .annotation .Configuration ;
6
+ import org .springframework .web .servlet .config .annotation .ViewControllerRegistry ;
7
+ import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
8
+
9
+ @ Configuration
10
+ @ ConditionalOnWebApplication
11
+ public class WebMvcViewControllerConfigurer {
12
+
13
+ @ Bean
14
+ public WebMvcConfigurer graphqiQLRedirectToIndex () {
15
+ return new WebMvcConfigurer () {
16
+ @ Override
17
+ public void addViewControllers (ViewControllerRegistry registry ) {
18
+ registry .addRedirectViewController ("/graphiql" , "graphiql/index.html" );
19
+ }
20
+ };
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2
+ com.introproventures.graphql.jpa.query.graphiql.WebMvcViewControllerConfigurer
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 8
8
<!DOCTYPE html>
9
9
< html >
10
10
< head >
11
+ < base href ="./ " />
11
12
< style >
12
13
body {
13
14
height : 100% ;
Original file line number Diff line number Diff line change
1
+ package com .introproventures .graphql .jpa .query .graphiql ;
2
+
3
+ import org .junit .Test ;
4
+ import org .junit .runner .RunWith ;
5
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
6
+ import org .springframework .boot .test .context .SpringBootTest ;
7
+ import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
8
+ import org .springframework .test .context .junit4 .SpringRunner ;
9
+
10
+ @ RunWith (SpringRunner .class )
11
+ @ SpringBootTest (webEnvironment = WebEnvironment .RANDOM_PORT )
12
+ public class WebMvcViewControllerConfigurerTest {
13
+
14
+ @ SpringBootApplication
15
+ static class Application {
16
+
17
+ }
18
+
19
+ @ Test
20
+ public void contextLoads () {
21
+ // success
22
+ }
23
+
24
+ }
You can’t perform that action at this time.
0 commit comments