Skip to content

Commit 360166f

Browse files
committed
feat: use application/json for graphql mimetype
Signed-off-by: Kevin Viglucci <[email protected]>
1 parent bce8ff8 commit 360166f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

packages/rsocket-graphql-apollo-link/src/QueryLink.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import {
3030
} from "rsocket-composite-metadata";
3131
import { print } from "graphql";
3232

33-
const APPLICATION_GRAPHQL_JSON = "application/graphql+json";
34-
3533
type QueryLinkOptions = {
3634
/**
3735
* The route that the RSocket server is listening for GraphQL messages on.
@@ -58,7 +56,7 @@ export class QueryLink extends ApolloLink {
5856
const metadata = new Map<WellKnownMimeType, Buffer>();
5957
metadata.set(
6058
WellKnownMimeType.MESSAGE_RSOCKET_MIMETYPE,
61-
Buffer.from(APPLICATION_GRAPHQL_JSON)
59+
Buffer.from(WellKnownMimeType.APPLICATION_JSON.toString())
6260
);
6361
if (this.options?.route) {
6462
metadata.set(

packages/rsocket-graphql-apollo-link/src/SubscriptionLink.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ type SubscriptionLinkOptions = {
4646
route?: string;
4747
};
4848

49-
const APPLICATION_GRAPHQL_JSON = "application/graphql+json";
50-
5149
export class SubscriptionClient {
5250
constructor(
5351
public readonly client: RSocket,
@@ -61,7 +59,7 @@ export class SubscriptionClient {
6159
const metadata = new Map<WellKnownMimeType, Buffer>();
6260
metadata.set(
6361
WellKnownMimeType.MESSAGE_RSOCKET_MIMETYPE,
64-
Buffer.from(APPLICATION_GRAPHQL_JSON)
62+
Buffer.from(WellKnownMimeType.APPLICATION_JSON.toString())
6563
);
6664
if (this.options?.route) {
6765
metadata.set(

0 commit comments

Comments
 (0)