Class GraphQlService.Builder

java.lang.Object
io.helidon.webserver.graphql.GraphQlService.Builder
All Implemented Interfaces:
Builder<GraphQlService.Builder, GraphQlService>, Supplier<GraphQlService>
Enclosing class:
GraphQlService

public static class GraphQlService.Builder extends Object implements Builder<GraphQlService.Builder, GraphQlService>
Fluent API builder to create GraphQlService.
  • Method Details

    • build

      public GraphQlService build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<GraphQlService.Builder, GraphQlService>
      Returns:
      instance of the built type
    • config

      public GraphQlService.Builder config(Config config)
      Update builder from configuration. Configuration options:
      Optional configuration parameters
      key default value description
      web-context "/graphql" Context that serves the GraphQL endpoint.
      schema-uri "/schema.graphql" URI that serves the schema (under web context)
      permit-all false Whether to permit access without authentication.
      Parameters:
      config - configuration to use
      Returns:
      updated builder instance
    • invocationHandler

      public GraphQlService.Builder invocationHandler(InvocationHandler handler)
      InvocationHandler to execute GraphQl requests.
      Parameters:
      handler - handler to use
      Returns:
      updated builder instance
    • invocationHandler

      public GraphQlService.Builder invocationHandler(Supplier<InvocationHandler> handler)
      InvocationHandler to execute GraphQl requests.
      Parameters:
      handler - handler to use
      Returns:
      updated builder instance
    • httpEntryPoints

      public GraphQlService.Builder httpEntryPoints(HttpEntryPoint.EntryPoints entryPoints, ServiceDescriptor<?> descriptor, Set<Qualifier> typeQualifiers, List<Annotation> typeAnnotations)
      Configure HTTP entry point wrapping for this GraphQL service.

      This is primarily used by generated declarative GraphQL features so request-level HTTP interceptors, such as WebServer security, can run before GraphQL request processing begins. Framework-owned schema and introspection requests use implicit authorization when the endpoint declares explicit authorization; application resolver entry points retain their declared authorization behavior.

      Parameters:
      entryPoints - HTTP entry points
      descriptor - descriptor of the declarative endpoint
      typeQualifiers - qualifiers of the declarative endpoint
      typeAnnotations - annotations of the declarative endpoint
      Returns:
      updated builder instance
    • declarativeHttpEntryPoints

      public GraphQlService.Builder declarativeHttpEntryPoints(HttpEntryPoint.EntryPoints entryPoints, ServiceDescriptor<?> descriptor, Set<Qualifier> typeQualifiers, List<Annotation> typeAnnotations)
      Configure HTTP entry point wrapping for a generated declarative GraphQL service.

      Unlike httpEntryPoints(HttpEntryPoint.EntryPoints, ServiceDescriptor, Set, List), this method may complete explicit request authorization after GraphQL execution when no resolver was invoked. Generated declarative services guarantee that every application resolver records its invocation before application code executes, so this cannot defer authorization until after an untracked resolver runs.

      Parameters:
      entryPoints - HTTP entry points
      descriptor - descriptor of the declarative endpoint
      typeQualifiers - qualifiers of the declarative endpoint
      typeAnnotations - annotations of the declarative endpoint
      Returns:
      updated builder instance
    • webContext

      public GraphQlService.Builder webContext(String path)
      Set a new root context for REST API of graphQL.
      Parameters:
      path - context to use
      Returns:
      updated builder instance
    • schemaUri

      public GraphQlService.Builder schemaUri(String uri)
      Configure URI that will serve the GraphQL schema under the context root.
      Parameters:
      uri - URI of the schema
      Returns:
      updated builder instance
    • permitAll

      public GraphQlService.Builder permitAll(boolean permitAll)
      Whether to permit access without authentication. This applies to GET and POST requests to the GraphQL endpoint and to the schema endpoint.
      Parameters:
      permitAll - whether requests are permitted without authentication
      Returns:
      updated builder instance
    • executor

      @Deprecated(since="27.0.0", forRemoval=true) public GraphQlService.Builder executor(ExecutorService executor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      GraphQL request processing does not use a dedicated executor
      Executor service to use for GraphQL processing.
      Parameters:
      executor - executor service
      Returns:
      updated builder instance
    • executor

      @Deprecated(since="27.0.0", forRemoval=true) public GraphQlService.Builder executor(Supplier<? extends ExecutorService> executor)
      Deprecated, for removal: This API element is subject to removal in a future version.
      GraphQL request processing does not use a dedicated executor
      Executor service to use for GraphQL processing.
      Parameters:
      executor - executor service
      Returns:
      updated builder instance