Remove usages of Framework's MediaType.APPLICATION_GRAPHQL
Closes gh-1109
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,9 +48,8 @@ final class HttpGraphQlTransport implements GraphQlTransport {
|
||||
private static final ParameterizedTypeReference<ServerSentEvent<Map<String, Object>>> SSE_TYPE =
|
||||
new ParameterizedTypeReference<ServerSentEvent<Map<String, Object>>>() { };
|
||||
|
||||
// To be removed in favor of Framework's MediaType.APPLICATION_GRAPHQL_RESPONSE
|
||||
private static final MediaType APPLICATION_GRAPHQL_RESPONSE =
|
||||
new MediaType("application", "graphql-response+json");
|
||||
private static final MediaType APPLICATION_GRAPHQL =
|
||||
new MediaType("application", "graphql+json");
|
||||
|
||||
|
||||
private final WebClient webClient;
|
||||
@@ -73,11 +72,10 @@ final class HttpGraphQlTransport implements GraphQlTransport {
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
public Mono<GraphQlResponse> execute(GraphQlRequest request) {
|
||||
return this.webClient.post()
|
||||
.contentType(this.contentType)
|
||||
.accept(MediaType.APPLICATION_JSON, APPLICATION_GRAPHQL_RESPONSE, MediaType.APPLICATION_GRAPHQL)
|
||||
.accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_GRAPHQL_RESPONSE, APPLICATION_GRAPHQL)
|
||||
.bodyValue(request.toMap())
|
||||
.attributes((attributes) -> {
|
||||
if (request instanceof ClientGraphQlRequest clientRequest) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020-2024 the original author or authors.
|
||||
* Copyright 2020-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,9 +36,11 @@ import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
*/
|
||||
public class GraphQlHttpHandler extends AbstractGraphQlHttpHandler {
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private static final MediaType APPLICATION_GRAPHQL =
|
||||
new MediaType("application", "graphql+json");
|
||||
|
||||
private static final List<MediaType> SUPPORTED_MEDIA_TYPES = List.of(
|
||||
MediaType.APPLICATION_GRAPHQL_RESPONSE, MediaType.APPLICATION_JSON, MediaType.APPLICATION_GRAPHQL);
|
||||
MediaType.APPLICATION_GRAPHQL_RESPONSE, MediaType.APPLICATION_JSON, APPLICATION_GRAPHQL);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020-2024 the original author or authors.
|
||||
* Copyright 2020-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -41,9 +41,11 @@ import org.springframework.web.servlet.function.ServerResponse;
|
||||
*/
|
||||
public class GraphQlHttpHandler extends AbstractGraphQlHttpHandler {
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private static final MediaType APPLICATION_GRAPHQL =
|
||||
new MediaType("application", "graphql+json");
|
||||
|
||||
private static final List<MediaType> SUPPORTED_MEDIA_TYPES = List.of(
|
||||
MediaType.APPLICATION_GRAPHQL_RESPONSE, MediaType.APPLICATION_JSON, MediaType.APPLICATION_GRAPHQL);
|
||||
MediaType.APPLICATION_GRAPHQL_RESPONSE, MediaType.APPLICATION_JSON, APPLICATION_GRAPHQL);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user