in graphql-dgs-client/src/main/kotlin/com/netflix/graphql/dgs/client/MonoGraphQLClient.kt [47:128]
fun reactiveExecuteQuery(
@Language("graphql") query: String,
variables: Map<String, Any>,
): Mono<GraphQLResponse>
/**
* A reactive call to execute a query and parse its result.
* Don't forget to subscribe() to actually send the query!
* @param query The query string. Note that you can use [code generation](https://netflix.github.io/dgs/generating-code-from-schema/#generating-query-apis-for-external-services) for a type safe query!
* @param variables A map of input variables
* @param operationName Name of the operation
* @return A [Mono] of [GraphQLResponse] parses the response and gives easy access to data and errors.
*/
fun reactiveExecuteQuery(
@Language("graphql") query: String,
variables: Map<String, Any>,
operationName: String?,
): Mono<GraphQLResponse>
@Deprecated(
"The RequestExecutor should be provided while creating the implementation. Use CustomGraphQLClient/CustomMonoGraphQLClient instead.",
ReplaceWith("Example: new CustomGraphQLClient(url, requestExecutor);"),
)
fun reactiveExecuteQuery(
@Language("graphql") query: String,
variables: Map<String, Any>,
requestExecutor: MonoRequestExecutor,
): Mono<GraphQLResponse> = throw UnsupportedOperationException()
@Deprecated(
"The RequestExecutor should be provided while creating the implementation. Use CustomGraphQLClient/CustomMonoGraphQLClient instead.",
ReplaceWith("Example: new CustomGraphQLClient(url, requestExecutor);"),
)
fun reactiveExecuteQuery(
@Language("graphql") query: String,
variables: Map<String, Any>,
operationName: String?,
requestExecutor: MonoRequestExecutor,
): Mono<GraphQLResponse> = throw UnsupportedOperationException()
companion object {
@JvmStatic
fun createCustomReactive(
@Language("url") url: String,
requestExecutor: MonoRequestExecutor,
) = CustomMonoGraphQLClient(url, requestExecutor)
@JvmStatic
fun createCustomReactive(
@Language("url") url: String,
requestExecutor: MonoRequestExecutor,
options: GraphQLRequestOptions,
) = CustomMonoGraphQLClient(url, requestExecutor, options)
@JvmStatic
fun createWithWebClient(webClient: WebClient) = WebClientGraphQLClient(webClient)
@JvmStatic
fun createWithWebClient(
webClient: WebClient,
objectMapper: ObjectMapper,
) = WebClientGraphQLClient(webClient, objectMapper)
@JvmStatic
fun createWithWebClient(
webClient: WebClient,
headersConsumer: Consumer<HttpHeaders>,
) = WebClientGraphQLClient(webClient, headersConsumer)
@JvmStatic
fun createWithWebClient(
webClient: WebClient,
options: GraphQLRequestOptions,
) = WebClientGraphQLClient(webClient, { }, options)
@JvmStatic
fun createWithWebClient(
webClient: WebClient,
headersConsumer: Consumer<HttpHeaders>,
options: GraphQLRequestOptions,
) = WebClientGraphQLClient(webClient, headersConsumer, options)
}