Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit eff2209

Browse files
committed
feat: move editor props inside graphql group
1 parent 8db422f commit eff2209

File tree

15 files changed

+41
-41
lines changed

15 files changed

+41
-41
lines changed

example/src/main/resources/application.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@ management:
1717
graphql:
1818
servlet:
1919
actuator-metrics: true
20-
altair:
21-
enabled: true
22-
cdn:
23-
enabled: false
24-
graphiql:
25-
enabled: true
26-
cdn:
27-
enabled: false
28-
version: 0.17.5
29-
headers:
30-
Test: TestHeader
31-
props:
32-
variables:
33-
headerEditorEnabled: true
34-
headers: '{ "Authorization": "SomeValue" }'
35-
voyager:
36-
enabled: true
37-
cdn:
38-
enabled: false
39-
graphql.playground:
40-
enabled: true
41-
cdn:
42-
enabled: false
43-
version: latest
20+
playground:
21+
enabled: true
22+
cdn:
23+
enabled: false
24+
version: latest
25+
altair:
26+
enabled: true
27+
cdn:
28+
enabled: false
29+
graphiql:
30+
enabled: true
31+
cdn:
32+
enabled: false
33+
version: 0.17.5
34+
headers:
35+
Test: TestHeader
36+
props:
37+
variables:
38+
headerEditorEnabled: true
39+
headers: '{ "Authorization": "SomeValue" }'
40+
voyager:
41+
enabled: true
42+
cdn:
43+
enabled: false

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/altair/AltairAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
public class AltairAutoConfiguration {
1717

1818
@Bean
19-
@ConditionalOnProperty(value = "altair.enabled", havingValue = "true")
19+
@ConditionalOnProperty(value = "graphql.altair.enabled", havingValue = "true")
2020
AltairController altairController() {
2121
return new AltairController();
2222
}

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/altair/AltairController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ private void loadTemplate() throws IOException {
5454
}
5555

5656
private void loadProps() throws IOException {
57-
props = new PropsLoader(environment, "altair.props.resources.", "altair.props.values.").load();
57+
props = new PropsLoader(environment, "graphql.altair.props.resources.", "graphql.altair.props.values.").load();
5858
}
5959

6060
private void loadHeaders() throws JsonProcessingException {
61-
PropertyGroupReader propertyReader = new PropertyGroupReader(environment, "altair.headers.");
61+
PropertyGroupReader propertyReader = new PropertyGroupReader(environment, "graphql.altair.headers.");
6262
Properties headerProperties = propertyReader.load();
6363
this.headers = new ObjectMapper().writeValueAsString(headerProperties);
6464
}
6565

66-
@GetMapping(value = "${altair.mapping:/altair}")
66+
@GetMapping(value = "${graphql.altair.mapping:/altair}")
6767
public void altair(
6868
HttpServletRequest request,
6969
HttpServletResponse response,

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/altair/AltairProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import org.springframework.boot.context.properties.ConfigurationProperties;
55

66
@Data
7-
@ConfigurationProperties("altair")
7+
@ConfigurationProperties("graphql.altair")
88
public class AltairProperties {
99

10-
private boolean enabled = true;
10+
private boolean enabled = false;
1111
private Endpoint endpoint = new Endpoint();
1212
private Cdn cdn = new Cdn();
1313
private String pageTitle = "Altair";

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/graphiql/GraphiQLAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @author Ronny Bräunlich
1616
*/
1717
@Configuration
18-
@ConditionalOnProperty(value = "graphiql.enabled", havingValue = "true")
18+
@ConditionalOnProperty(value = "graphql.graphiql.enabled", havingValue = "true")
1919
@EnableConfigurationProperties(GraphiQLProperties.class)
2020
public class GraphiQLAutoConfiguration {
2121

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/graphiql/GraphiQLProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.springframework.boot.context.properties.ConfigurationProperties;
55

66
@Data
7-
@ConfigurationProperties("graphiql")
7+
@ConfigurationProperties("graphql.graphiql")
88
class GraphiQLProperties {
99

1010
private boolean enabled = false;

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/graphiql/ReactiveGraphiQLController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void onceConstructed() throws IOException {
2626
super.onceConstructed();
2727
}
2828

29-
@GetMapping(value = "${graphiql.mapping:/graphiql}")
29+
@GetMapping(value = "${graphql.graphiql.mapping:/graphiql}")
3030
public Mono<Void> graphiql(
3131
ServerHttpRequest request,
3232
ServerHttpResponse response,

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/graphiql/ServletGraphiQLController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void onceConstructed() throws IOException {
2121
super.onceConstructed();
2222
}
2323

24-
@GetMapping(value = "${graphiql.mapping:/graphiql}")
24+
@GetMapping(value = "${graphql.graphiql.mapping:/graphiql}")
2525
public void graphiql(
2626
HttpServletRequest request,
2727
HttpServletResponse response,

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/voyager/ReactiveVoyagerAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/** @author Max David Günther */
1414
@Configuration
1515
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
16-
@ConditionalOnProperty(value = "voyager.enabled", havingValue = "true", matchIfMissing = true)
16+
@ConditionalOnProperty(value = "graphql.voyager.enabled", havingValue = "true", matchIfMissing = true)
1717
@EnableConfigurationProperties(VoyagerPropertiesConfiguration.class)
1818
public class ReactiveVoyagerAutoConfiguration {
1919

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/voyager/ReactiveVoyagerController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class ReactiveVoyagerController {
1717

1818
@Autowired private VoyagerIndexHtmlTemplate indexTemplate;
1919

20-
@GetMapping(path = "${voyager.mapping:/voyager}")
20+
@GetMapping(path = "${graphql.voyager.mapping:/voyager}")
2121
public ResponseEntity<String> voyager(@PathVariable Map<String, String> params)
2222
throws IOException {
2323
// no context path in spring-webflux

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/voyager/VoyagerAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/** @author Guilherme Blanco */
1010
@Configuration
1111
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
12-
@ConditionalOnProperty(value = "voyager.enabled", havingValue = "true", matchIfMissing = true)
12+
@ConditionalOnProperty(value = "graphql.voyager.enabled", havingValue = "true", matchIfMissing = true)
1313
@EnableConfigurationProperties(VoyagerPropertiesConfiguration.class)
1414
public class VoyagerAutoConfiguration {
1515

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/voyager/VoyagerController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class VoyagerController {
1616

1717
@Autowired private VoyagerIndexHtmlTemplate indexTemplate;
1818

19-
@GetMapping(value = "${voyager.mapping:/voyager}")
19+
@GetMapping(value = "${graphql.voyager.mapping:/voyager}")
2020
public ResponseEntity<String> voyager(
2121
HttpServletRequest request, @PathVariable Map<String, String> params) throws IOException {
2222
String contextPath = request.getContextPath();

graphql-spring-boot-autoconfigure/src/main/java/graphql/kickstart/autoconfigure/editor/voyager/VoyagerPropertiesConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
import org.springframework.validation.annotation.Validated;
1010

1111
@Data
12-
@ConfigurationProperties(prefix = "voyager")
12+
@ConfigurationProperties(prefix = "graphql.voyager")
1313
@Validated
1414
public class VoyagerPropertiesConfiguration {
1515

16+
private boolean enabled = false;
17+
1618
private String endpoint = "/graphql";
1719

1820
private String pageTitle = "Voyager";

graphql-spring-boot-autoconfigure/src/test/java/graphql/kickstart/autoconfigure/web/servlet/CorsTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
@ImportAutoConfiguration({JacksonAutoConfiguration.class, GraphQLWebAutoConfiguration.class})
2929
@SpringBootTest(
3030
properties = {
31-
"debug=true",
3231
"graphql.servlet.mapping=/graphql",
3332
"graphql.servlet.cors.allowed-origins=https://trusted.com"
3433
})
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
graphql:
22
schema-strategy: annotations
3-
debug: true

0 commit comments

Comments
 (0)