Interface GraphQlClient.Builder<B extends GraphQlClient.Builder<B>>
- Type Parameters:
B- the client builder type
- All Known Subinterfaces:
HttpGraphQlClient.Builder<B>,RSocketGraphQlClient.Builder<B>,WebGraphQlClient.Builder<B>,WebSocketGraphQlClient.Builder<B>
- All Known Implementing Classes:
AbstractGraphQlClientBuilder
- Enclosing interface:
- GraphQlClient
public static interface GraphQlClient.Builder<B extends GraphQlClient.Builder<B>>
Defines a builder for creating
GraphQlClient instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theGraphQlClientinstance.documentSource(DocumentSource contentLoader) Configure aDocumentSourcefor use withGraphQlClient.documentName(String)for resolving a document by name.interceptor(GraphQlClientInterceptor... interceptors) Configure interceptors to be invoked before delegating to theGraphQlTransportto perform the request.interceptors(Consumer<List<GraphQlClientInterceptor>> interceptorsConsumer) Customize the list of interceptors.
-
Method Details
-
interceptor
Configure interceptors to be invoked before delegating to theGraphQlTransportto perform the request.- Parameters:
interceptors- the interceptors to add- Returns:
- this builder
-
interceptors
Customize the list of interceptors. The provided list is "live", so the consumer can inspect and insert interceptors accordingly.- Parameters:
interceptorsConsumer- consumer to customize the interceptors with- Returns:
- this builder
-
documentSource
Configure aDocumentSourcefor use withGraphQlClient.documentName(String)for resolving a document by name.By default, this is set to
ResourceDocumentSourcewith classpath location"graphql-documents/"andResourceDocumentSource.FILE_EXTENSIONSas extensions.- Parameters:
contentLoader- the document source
-
build
GraphQlClient build()Build theGraphQlClientinstance.
-