Skip to content

Commit

Permalink
Merge pull request #35769 from ivanp/patch-1
Browse files Browse the repository at this point in the history
Default response content type using GraphQL spec
  • Loading branch information
gsmet authored Oct 11, 2023
2 parents 7a88aa6 + 5550b70 commit 3d81f91
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class SmallRyeGraphQLExecutionHandler extends SmallRyeGraphQLAbstractHand
private static final String EXTENSIONS = "extensions";
private static final String APPLICATION_GRAPHQL = "application/graphql";
private static final String OK = "OK";
private static final String DEFAULT_RESPONSE_CONTENT_TYPE = "application/graphql+json; charset="
private static final String DEFAULT_RESPONSE_CONTENT_TYPE = "application/graphql-response+json; charset="
+ StandardCharsets.UTF_8.name();
private static final String DEFAULT_REQUEST_CONTENT_TYPE = "application/json; charset="
+ StandardCharsets.UTF_8.name();
Expand Down Expand Up @@ -295,8 +295,9 @@ private static String getCharset(String mimeType) {
}

private boolean isValidAcceptRequest(String mimeType) {
// At this point we only accept two
return mimeType.startsWith("application/json")
|| mimeType.startsWith("application/graphql-response+json")
// application/graphql+json is incorrect, but we keep it for backwards compatibility
|| mimeType.startsWith("application/graphql+json");
}

Expand Down

0 comments on commit 3d81f91

Please sign in to comment.