Package io.vertx.ext.web.handler.graphql
Class GraphiQLHandlerOptions
- java.lang.Object
-
- io.vertx.ext.web.handler.graphql.GraphiQLHandlerOptions
-
public class GraphiQLHandlerOptions extends Object
Embedded GraphiQL user interface options.- Author:
- Thomas Segismont
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ENABLEDWhether GraphiQL development tool should be enabled by default = false.static StringDEFAULT_GRAPHQL_URIDefault URI for HTTP and GraphQLWS endpoints = /graphql.static booleanDEFAULT_GRAPHQL_WS_ENABLEDWhether GraphQLWS transport should be enabled by default = true.static booleanDEFAULT_HTTP_ENABLEDWhether HTTP transport should be enabled by default = true.
-
Constructor Summary
Constructors Constructor Description GraphiQLHandlerOptions()Default constructor.GraphiQLHandlerOptions(JsonObject json)Constructor to create options from JSON.GraphiQLHandlerOptions(GraphiQLHandlerOptions other)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetGraphQLUri()StringgetGraphQLWSUri()Map<String,String>getHeaders()StringgetQuery()JsonObjectgetVariables()JsonObjectgetWsConnectionParams()booleanisEnabled()booleanisGraphQLWSEnabled()booleanisHttpEnabled()GraphiQLHandlerOptionssetEnabled(boolean enabled)Whether the GraphiQL development tool should be enabled.GraphiQLHandlerOptionssetGraphQLUri(String graphQLUri)Set the GraphQL HTTP endpoint URI.GraphiQLHandlerOptionssetGraphQLWSEnabled(boolean graphQLWSEnabled)Whether the GraphQLWS transport should be enabled.GraphiQLHandlerOptionssetGraphWSQLUri(String graphQLWSUri)Set the GraphQLWS endpoint URI.GraphiQLHandlerOptionssetHeaders(Map<String,String> headers)A fixed set of HTTP headers to add to GraphiQL requests.GraphiQLHandlerOptionssetHttpEnabled(boolean httpEnabled)Whether the HTTP transport should be enabled.GraphiQLHandlerOptionssetQuery(String query)Initial value of the query area in the GraphiQL user interface.GraphiQLHandlerOptionssetVariables(JsonObject variables)Initial value of the variables area in the GraphiQL user interface.GraphiQLHandlerOptionssetWsConnectionParams(JsonObject wsConnectionParams)Initial GraphQLWS connection params.JsonObjecttoJson()
-
-
-
Field Detail
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
Whether GraphiQL development tool should be enabled by default = false.
-
DEFAULT_HTTP_ENABLED
public static final boolean DEFAULT_HTTP_ENABLED
Whether HTTP transport should be enabled by default = true.- See Also:
- Constant Field Values
-
DEFAULT_GRAPHQL_URI
public static final String DEFAULT_GRAPHQL_URI
Default URI for HTTP and GraphQLWS endpoints = /graphql.- See Also:
- Constant Field Values
-
DEFAULT_GRAPHQL_WS_ENABLED
public static final boolean DEFAULT_GRAPHQL_WS_ENABLED
Whether GraphQLWS transport should be enabled by default = true.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphiQLHandlerOptions
public GraphiQLHandlerOptions()
Default constructor.
-
GraphiQLHandlerOptions
public GraphiQLHandlerOptions(GraphiQLHandlerOptions other)
Copy constructor.- Parameters:
other- the options to copy
-
GraphiQLHandlerOptions
public GraphiQLHandlerOptions(JsonObject json)
Constructor to create options from JSON.- Parameters:
json- the JSON
-
-
Method Detail
-
toJson
public JsonObject toJson()
- Returns:
- a JSON representation of these options
-
isEnabled
public boolean isEnabled()
- Returns:
trueif the GraphiQL development tool should be enabled,falseotherwise
-
setEnabled
public GraphiQLHandlerOptions setEnabled(boolean enabled)
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
public GraphiQLHandlerOptions setHttpEnabled(boolean httpEnabled)
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
public String getGraphQLUri()
- Returns:
- the GraphQL endpoint URI
-
setGraphQLUri
public GraphiQLHandlerOptions setGraphQLUri(String graphQLUri)
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
public GraphiQLHandlerOptions setGraphQLWSEnabled(boolean graphQLWSEnabled)
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
public String getGraphQLWSUri()
- Returns:
- the GraphQLWS endpoint URI
-
setGraphWSQLUri
public GraphiQLHandlerOptions setGraphWSQLUri(String graphQLWSUri)
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
public Map<String,String> getHeaders()
- Returns:
- the fixed set of HTTP headers to add to GraphiQL requests
-
setHeaders
public GraphiQLHandlerOptions setHeaders(Map<String,String> headers)
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
public JsonObject getWsConnectionParams()
- Returns:
- the initial GraphQLWS connection params
-
setWsConnectionParams
public GraphiQLHandlerOptions setWsConnectionParams(JsonObject wsConnectionParams)
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
public String getQuery()
- Returns:
- the query to set as initial value in the GraphiQL user interface
-
setQuery
public GraphiQLHandlerOptions setQuery(String query)
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
public JsonObject getVariables()
- Returns:
- the variables to set as initial value in the GraphiQL user interface
-
setVariables
public GraphiQLHandlerOptions setVariables(JsonObject variables)
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
-
-