Class GraphiQLHandlerOptions
java.lang.Object
io.vertx.ext.web.handler.graphql.GraphiQLHandlerOptions
Embedded GraphiQL user interface options.
- Author:
- Thomas Segismont
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanWhether GraphiQL development tool should be enabled by default = false.static final StringDefault URI for HTTP and GraphQLWS endpoints = /graphql.static final booleanWhether GraphQLWS transport should be enabled by default = true.static final booleanWhether HTTP transport should be enabled by default = true. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Constructor to create options from JSON.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetQuery()booleanbooleanbooleansetEnabled(boolean enabled) Whether the GraphiQL development tool should be enabled.setGraphQLUri(String graphQLUri) Set the GraphQL HTTP endpoint URI.setGraphQLWSEnabled(boolean graphQLWSEnabled) Whether the GraphQLWS transport should be enabled.setGraphWSQLUri(String graphQLWSUri) Set the GraphQLWS endpoint URI.setHeaders(Map<String, String> headers) A fixed set of HTTP headers to add to GraphiQL requests.setHttpEnabled(boolean httpEnabled) Whether the HTTP transport should be enabled.Initial value of the query area in the GraphiQL user interface.setVariables(JsonObject variables) Initial value of the variables area in the GraphiQL user interface.setWsConnectionParams(JsonObject wsConnectionParams) Initial GraphQLWS connection params.toJson()
-
Field Details
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDWhether GraphiQL development tool should be enabled by default = false. -
DEFAULT_HTTP_ENABLED
public static final boolean DEFAULT_HTTP_ENABLEDWhether HTTP transport should be enabled by default = true.- See Also:
-
DEFAULT_GRAPHQL_URI
Default URI for HTTP and GraphQLWS endpoints = /graphql.- See Also:
-
DEFAULT_GRAPHQL_WS_ENABLED
public static final boolean DEFAULT_GRAPHQL_WS_ENABLEDWhether GraphQLWS transport should be enabled by default = true.- See Also:
-
-
Constructor Details
-
GraphiQLHandlerOptions
public GraphiQLHandlerOptions()Default constructor. -
GraphiQLHandlerOptions
Copy constructor.- Parameters:
other- the options to copy
-
GraphiQLHandlerOptions
Constructor to create options from JSON.- Parameters:
json- the JSON
-
-
Method Details
-
toJson
- Returns:
- a JSON representation of these options
-
isEnabled
public boolean isEnabled()- Returns:
trueif the GraphiQL development tool should be enabled,falseotherwise
-
setEnabled
Whether the GraphiQL development tool should be enabled. Defaults tofalse.- Parameters:
enabled-trueto enable the GraphiQL development tool,falseotherwise- Returns:
- a reference to this, so the API can be used fluently
-
isHttpEnabled
public boolean isHttpEnabled()- Returns:
trueif the HTTP transport should be enabled,trueotherwise
-
setHttpEnabled
Whether the HTTP transport should be enabled. Defaults totrue.- Parameters:
httpEnabled-trueto enable the HTTP transport,falseotherwise- Returns:
- a reference to this, so the API can be used fluently
-
getGraphQLUri
- Returns:
- the GraphQL endpoint URI
-
setGraphQLUri
Set the GraphQL HTTP endpoint URI. Defaults toDEFAULT_GRAPHQL_URI.- Parameters:
graphQLUri- the GraphQL HTTP endpoint URI- Returns:
- a reference to this, so the API can be used fluently
-
isGraphQLWSEnabled
public boolean isGraphQLWSEnabled()- Returns:
trueif the GraphQLWS transport should be enabled,trueotherwise
-
setGraphQLWSEnabled
Whether the GraphQLWS transport should be enabled. Defaults totrue.- Parameters:
graphQLWSEnabled-trueto enable the GraphQLWS transport,falseotherwise- Returns:
- a reference to this, so the API can be used fluently
-
getGraphQLWSUri
- Returns:
- the GraphQLWS endpoint URI
-
setGraphWSQLUri
Set the GraphQLWS endpoint URI. Defaults toDEFAULT_GRAPHQL_URI.- Parameters:
graphQLWSUri- the GraphQLWS endpoint URI- Returns:
- a reference to this, so the API can be used fluently
-
getHeaders
-
setHeaders
A fixed set of HTTP headers to add to GraphiQL requests. Defaults tonull.- Parameters:
headers- the set of HTTP headers to add to GraphiQL requests- Returns:
- a reference to this, so the API can be used fluently
-
getWsConnectionParams
- Returns:
- the initial GraphQLWS connection params
-
setWsConnectionParams
Initial GraphQLWS connection params. Defaults tonull.- Parameters:
wsConnectionParams- the initial GraphQLWS connection params- Returns:
- a reference to this, so the API can be used fluently
-
getQuery
- Returns:
- the query to set as initial value in the GraphiQL user interface
-
setQuery
Initial value of the query area in the GraphiQL user interface. Defaults tonull.- Parameters:
query- the query to set as initial value- Returns:
- a reference to this, so the API can be used fluently
-
getVariables
- Returns:
- the variables to set as initial value in the GraphiQL user interface
-
setVariables
Initial value of the variables area in the GraphiQL user interface. Defaults tonull.- Parameters:
variables- the variables to set as initial value- Returns:
- a reference to this, so the API can be used fluently
-