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 and Description
    --- | ---
    `static boolean` | `DEFAULT_ENABLED` Whether GraphiQL development tool should be enabled by default = false.
    `static String` | `DEFAULT_GRAPHQL_URI` Default URI for HTTP and GraphQLWS endpoints = /graphql.
    `static boolean` | `DEFAULT_GRAPHQL_WS_ENABLED` Whether GraphQLWS transport should be enabled by default = true.
    `static boolean` | `DEFAULT_HTTP_ENABLED` Whether HTTP transport should be enabled by default = true.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GraphiQLHandlerOptions()` Default constructor.
    `GraphiQLHandlerOptions(GraphiQLHandlerOptions other)` Copy constructor.
    `GraphiQLHandlerOptions(JsonObject json)` Constructor to create options from JSON.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getGraphQLUri()`
    `String` | `getGraphQLWSUri()`
    `Map<String,String>` | `getHeaders()`
    `String` | `getQuery()`
    `JsonObject` | `getVariables()`
    `JsonObject` | `getWsConnectionParams()`
    `boolean` | `isEnabled()`
    `boolean` | `isGraphQLWSEnabled()`
    `boolean` | `isHttpEnabled()`
    `GraphiQLHandlerOptions` | `setEnabled(boolean enabled)` Whether the GraphiQL development tool should be enabled.
    `GraphiQLHandlerOptions` | `setGraphQLUri(String graphQLUri)` Set the GraphQL HTTP endpoint URI.
    `GraphiQLHandlerOptions` | `setGraphQLWSEnabled(boolean graphQLWSEnabled)` Whether the GraphQLWS transport should be enabled.
    `GraphiQLHandlerOptions` | `setGraphWSQLUri(String graphQLWSUri)` Set the GraphQLWS endpoint URI.
    `GraphiQLHandlerOptions` | `setHeaders(Map<String,String> headers)` A fixed set of HTTP headers to add to GraphiQL requests.
    `GraphiQLHandlerOptions` | `setHttpEnabled(boolean httpEnabled)` Whether the HTTP transport should be enabled.
    `GraphiQLHandlerOptions` | `setQuery(String query)` Initial value of the query area in the GraphiQL user interface.
    `GraphiQLHandlerOptions` | `setVariables(JsonObject variables)` Initial value of the variables area in the GraphiQL user interface.
    `GraphiQLHandlerOptions` | `setWsConnectionParams(JsonObject wsConnectionParams)` Initial GraphQLWS connection params.
    `JsonObject` | `toJson()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

Copyright © 2024 Eclipse. All rights reserved.