-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
SmallRyeGraphQLConfig.java
210 lines (176 loc) · 6.46 KB
/
SmallRyeGraphQLConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
package io.quarkus.smallrye.graphql.runtime;
import java.util.List;
import java.util.Optional;
import io.quarkus.runtime.annotations.ConfigDocSection;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.smallrye.graphql.schema.helper.TypeAutoNameStrategy;
import io.smallrye.graphql.spi.config.LogPayloadOption;
@ConfigRoot(name = "smallrye-graphql", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
public class SmallRyeGraphQLConfig {
/**
* The rootPath under which queries will be served. Default to graphql
* By default, this value will be resolved as a path relative to `${quarkus.http.root-path}`.
*/
@ConfigItem(defaultValue = "graphql")
public String rootPath;
/**
* Enable metrics. By default, this is false. If set to true, a metrics extension is required.
*/
@ConfigItem(name = "metrics.enabled")
public Optional<Boolean> metricsEnabled;
/**
* Enable tracing. By default, this will be enabled if the tracing extension is added.
*/
@ConfigItem(name = "tracing.enabled")
public Optional<Boolean> tracingEnabled;
/**
* Enable validation. By default, this will be enabled if the Hibernate Validator extension is added.
*/
@ConfigItem(name = "validation.enabled")
public Optional<Boolean> validationEnabled;
/**
* Enable eventing. Allow you to receive events on bootstrap and execution.
*/
@ConfigItem(name = "events.enabled", defaultValue = "false")
public boolean eventsEnabled;
/**
* Enable non-blocking support. Default is true.
*/
@ConfigItem(name = "nonblocking.enabled")
public Optional<Boolean> nonBlockingEnabled;
/**
* Enable GET Requests. Allow queries via HTTP GET.
*/
@ConfigItem(name = "http.get.enabled")
public Optional<Boolean> httpGetEnabled;
/**
* Enable Query parameter on POST Requests. Allow POST request to override or supply values in a query parameter.
*/
@ConfigItem(name = "http.post.queryparameters.enabled")
public Optional<Boolean> httpPostQueryParametersEnabled;
/**
* Change the type naming strategy.
*/
@ConfigItem(defaultValue = "Default")
public TypeAutoNameStrategy autoNameStrategy;
/**
* List of extension fields that should be included in the error response.
* By default, none will be included. Examples of valid values include
* [exception,classification,code,description,validationErrorType,queryPath]
*/
@ConfigItem
public Optional<List<String>> errorExtensionFields;
/**
* List of Runtime Exceptions class names that should show the error message.
* By default, Runtime Exception messages will be hidden and a generic `Server Error` message will be returned.
*/
@ConfigItem
public Optional<List<String>> showRuntimeExceptionMessage;
/**
* List of Checked Exceptions class names that should hide the error message.
* By default, Checked Exception messages will show the exception message.
*/
@ConfigItem
public Optional<List<String>> hideCheckedExceptionMessage;
/**
* The default error message that will be used for hidden exception messages.
* Defaults to "Server Error"
*/
@ConfigItem
public Optional<String> defaultErrorMessage;
/**
* Print the data fetcher exception to the log file. Default `true` in dev and test mode, default `false` in prod.
*/
@ConfigItem
public Optional<Boolean> printDataFetcherException;
/**
* Make the schema available over HTTP.
*/
@ConfigItem(defaultValue = "true")
public boolean schemaAvailable;
/**
* Include the Scalar definitions in the schema.
*/
@ConfigItem(defaultValue = "false")
public boolean schemaIncludeScalars;
/**
* Include the schema internal definition in the schema.
*/
@ConfigItem(defaultValue = "false")
public boolean schemaIncludeSchemaDefinition;
/**
* Include Directives in the schema.
*/
@ConfigItem(defaultValue = "false")
public boolean schemaIncludeDirectives;
/**
* Include Introspection Types in the schema.
*/
@ConfigItem(defaultValue = "false")
public boolean schemaIncludeIntrospectionTypes;
/**
* Log the payload (and optionally variables) to System out.
*/
@ConfigItem(defaultValue = "off")
public LogPayloadOption logPayload;
/**
* Set the Field visibility.
*/
@ConfigItem(defaultValue = "default")
public String fieldVisibility;
/**
* Exceptions that should be unwrapped (class names).
*/
@ConfigItem
public Optional<List<String>> unwrapExceptions;
/**
* Subprotocols that should be supported by the server for graphql-over-websocket use cases.
* Allowed subprotocols are "graphql-ws" and "graphql-transport-ws". By default, both are enabled.
*/
@ConfigItem
public Optional<List<String>> websocketSubprotocols;
/**
* Set to true if ignored chars should be captured as AST nodes. Default to false
*/
@ConfigItem
public Optional<Boolean> parserCaptureIgnoredChars;
/**
* Set to true if `graphql.language.Comment`s should be captured as AST nodes
*/
@ConfigItem
public Optional<Boolean> parserCaptureLineComments;
/**
* Set to true true if `graphql.language.SourceLocation`s should be captured as AST nodes. Default to true
*/
@ConfigItem
public Optional<Boolean> parserCaptureSourceLocation;
/**
* The maximum number of raw tokens the parser will accept, after which an exception will be thrown. Default to 15000
*/
@ConfigItem
public Optional<Integer> parserMaxTokens;
/**
* The maximum number of raw whitespace tokens the parser will accept, after which an exception will be thrown. Default to
* 200000
*/
@ConfigItem
public Optional<Integer> parserMaxWhitespaceTokens;
/**
* Abort a query if the total number of data fields queried exceeds the defined limit. Default to no limit
*/
@ConfigItem
public Optional<Integer> instrumentationQueryComplexity;
/**
* Abort a query if the total depth of the query exceeds the defined limit. Default to no limit
*/
@ConfigItem
public Optional<Integer> instrumentationQueryDepth;
/**
* SmallRye GraphQL UI configuration
*/
@ConfigItem
@ConfigDocSection
public SmallRyeGraphQLUIConfig ui;
}