Class GraphiQLHandlerOptions


  • public class GraphiQLHandlerOptions
    extends Object
    Embedded GraphiQL user interface options.
    Author:
    Thomas Segismont
    • 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:
        true if the GraphiQL development tool should be enabled, false otherwise
      • setEnabled

        public GraphiQLHandlerOptions setEnabled​(boolean enabled)
        Whether the GraphiQL development tool should be enabled. Defaults to false.
        Parameters:
        enabled - true to enable the GraphiQL development tool, false otherwise
        Returns:
        a reference to this, so the API can be used fluently
      • isHttpEnabled

        public boolean isHttpEnabled()
        Returns:
        true if the HTTP transport should be enabled, true otherwise
      • setHttpEnabled

        public GraphiQLHandlerOptions setHttpEnabled​(boolean httpEnabled)
        Whether the HTTP transport should be enabled. Defaults to true.
        Parameters:
        httpEnabled - true to enable the HTTP transport, false otherwise
        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 to DEFAULT_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:
        true if the GraphQLWS transport should be enabled, true otherwise
      • setGraphQLWSEnabled

        public GraphiQLHandlerOptions setGraphQLWSEnabled​(boolean graphQLWSEnabled)
        Whether the GraphQLWS transport should be enabled. Defaults to true.
        Parameters:
        graphQLWSEnabled - true to enable the GraphQLWS transport, false otherwise
        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 to DEFAULT_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 to null.
        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 to null.
        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 to null.
        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 to null.
        Parameters:
        variables - the variables to set as initial value
        Returns:
        a reference to this, so the API can be used fluently