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

Commit 3198855

Browse files
feat(#212): Added configuration properties for GraphQL Playground tabs
1 parent a3b7323 commit 3198855

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

playground-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/playground/boot/PlaygroundProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import lombok.Data;
88

99
import javax.validation.constraints.NotEmpty;
10+
import java.util.List;
1011

1112
@Data
1213
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE,
@@ -31,4 +32,7 @@ public class PlaygroundProperties {
3132

3233
@JsonProperty
3334
private PlaygroundSettings settings;
35+
36+
@JsonProperty
37+
private List<PlaygroundTab> tabs;
3438
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.oembedler.moon.playground.boot;
2+
3+
import lombok.Data;
4+
5+
import java.util.List;
6+
import java.util.Map;
7+
8+
@Data
9+
public class PlaygroundTab {
10+
11+
/**
12+
* The GraphQL endpoint for this tab. If not set, the default GraphQL endpoint will be used.
13+
*/
14+
private String endpoint;
15+
16+
/**
17+
* The GraphQL query (operation) to be initially displayed on the tab.
18+
*/
19+
private String query;
20+
21+
/**
22+
* The name of the tab.
23+
*/
24+
private String name;
25+
26+
/**
27+
* The query variables. It should be a serialized JSON.
28+
*/
29+
private String variables;
30+
31+
/**
32+
* The list of responses to be displayed under "responses". Should be a list of serialized JSONs.
33+
*/
34+
private List<String> responses;
35+
36+
/**
37+
* HTTP headers. Key-value pairs expected.
38+
*/
39+
private Map<String, String> headers;
40+
}

0 commit comments

Comments
 (0)