Class GraphqlServiceBuilder
java.lang.Object
com.linecorp.armeria.server.graphql.GraphqlServiceBuilder
Constructs a
GraphqlService to serve GraphQL within Armeria.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aGraphqlService.configureDataLoaderRegistry(Iterable<? extends Consumer<? super org.dataloader.DataLoaderRegistry>> configurers) Deprecated.configureDataLoaderRegistry(Consumer<org.dataloader.DataLoaderRegistry>... configurers) Deprecated.UsedataLoaderRegistry(Function)instead.configureGraphql(GraphqlConfigurator... configurers) Adds theGraphqlConfiguratorconsumers.configureGraphql(Iterable<? extends GraphqlConfigurator> configurers) Adds theGraphqlConfiguratorconsumers.dataLoaderRegistry(Function<? super com.linecorp.armeria.server.ServiceRequestContext, ? extends org.dataloader.DataLoaderRegistry> dataLoaderRegistryFactory) SetsDataLoaderRegistrycreation function.enableWebSocket(boolean enableWebSocket) Enables GraphQL over WebSocket Protocol.errorHandler(GraphqlErrorHandler errorHandler) Adds theGraphqlErrorHandler.executionIdGenerator(ExecutionIdGenerator executionIdGenerator) Sets theExecutionIdGenerator.instrumentation(graphql.execution.instrumentation.Instrumentation... instrumentations) Adds theInstrumentations.instrumentation(Iterable<? extends graphql.execution.instrumentation.Instrumentation> instrumentations) Adds theInstrumentations.runtimeWiring(RuntimeWiringConfigurator... runtimeWiringConfigurators) Adds theRuntimeWiringConfigurators.runtimeWiring(Iterable<? extends RuntimeWiringConfigurator> configurators) Adds theRuntimeWiringConfigurators.schema(graphql.schema.GraphQLSchema schema) Sets theGraphQLSchema.schemaFile(File... schemaFiles) Adds the schemaFiles.schemaFile(Iterable<? extends File> schemaFiles) Adds the schemaFiles.schemaUrls(Iterable<String> schemaUrls) Adds the schema loaded from the given URLs.schemaUrls(String... schemaUrls) Adds the schema loaded from the given URLs.typeVisitors(graphql.schema.GraphQLTypeVisitor... typeVisitors) Adds theGraphQLTypeVisitors.typeVisitors(Iterable<? extends graphql.schema.GraphQLTypeVisitor> typeVisitors) Adds theGraphQLTypeVisitors.useBlockingTaskExecutor(boolean useBlockingTaskExecutor) Sets whether the service executes service methods using the blocking executor.webSocketServiceCustomizer(Consumer<com.linecorp.armeria.server.websocket.WebSocketServiceBuilder> webSocketServiceCustomizer) Sets an optionalWebSocketServiceBuildercustomizer.
-
Method Details
-
schemaFile
Adds the schemaFiles. If not set, theschema.graphqlorschema.graphqlswill be imported from the resource. -
schemaFile
Adds the schemaFiles. If not set, theschema.graphqlorschema.graphqlswill be imported from the resource. -
schemaUrls
Adds the schema loaded from the given URLs. If not set, theschema.graphqlorschema.graphqlswill be imported from the resource. -
schemaUrls
Adds the schema loaded from the given URLs. If not set, theschema.graphqlorschema.graphqlswill be imported from the resource. -
schema
Sets theGraphQLSchema. -
dataLoaderRegistry
public GraphqlServiceBuilder dataLoaderRegistry(Function<? super com.linecorp.armeria.server.ServiceRequestContext, ? extends org.dataloader.DataLoaderRegistry> dataLoaderRegistryFactory) SetsDataLoaderRegistrycreation function. -
configureDataLoaderRegistry
@Deprecated public GraphqlServiceBuilder configureDataLoaderRegistry(Consumer<org.dataloader.DataLoaderRegistry>... configurers) Deprecated.UsedataLoaderRegistry(Function)instead.Adds theDataLoaderRegistryconsumers. -
configureDataLoaderRegistry
@Deprecated public GraphqlServiceBuilder configureDataLoaderRegistry(Iterable<? extends Consumer<? super org.dataloader.DataLoaderRegistry>> configurers) Deprecated.UsedataLoaderRegistry(Function)instead.Adds theDataLoaderRegistryconsumers. -
runtimeWiring
Adds theRuntimeWiringConfigurators. -
runtimeWiring
public GraphqlServiceBuilder runtimeWiring(Iterable<? extends RuntimeWiringConfigurator> configurators) Adds theRuntimeWiringConfigurators. -
typeVisitors
Adds theGraphQLTypeVisitors. -
typeVisitors
public GraphqlServiceBuilder typeVisitors(Iterable<? extends graphql.schema.GraphQLTypeVisitor> typeVisitors) Adds theGraphQLTypeVisitors. -
instrumentation
public GraphqlServiceBuilder instrumentation(graphql.execution.instrumentation.Instrumentation... instrumentations) Adds theInstrumentations. -
instrumentation
public GraphqlServiceBuilder instrumentation(Iterable<? extends graphql.execution.instrumentation.Instrumentation> instrumentations) Adds theInstrumentations. -
configureGraphql
Adds theGraphqlConfiguratorconsumers. -
configureGraphql
Adds theGraphqlConfiguratorconsumers. -
useBlockingTaskExecutor
Sets whether the service executes service methods using the blocking executor. -
enableWebSocket
Enables GraphQL over WebSocket Protocol. -
webSocketServiceCustomizer
public GraphqlServiceBuilder webSocketServiceCustomizer(Consumer<com.linecorp.armeria.server.websocket.WebSocketServiceBuilder> webSocketServiceCustomizer) Sets an optionalWebSocketServiceBuildercustomizer. -
errorHandler
Adds theGraphqlErrorHandler. If multiple handlers are added, the latter is composed with the former one usingGraphqlErrorHandler.orElse(GraphqlErrorHandler).If not specified,
GraphqlErrorHandler.of()is used by default. -
executionIdGenerator
Sets theExecutionIdGenerator. If not specified,ExecutionIdGenerator.of()is used by default. -
build
Creates aGraphqlService.
-
dataLoaderRegistry(Function)instead.