Skip to content

Commit

Permalink
fix: update subscription protocol (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisnithin authored Feb 13, 2024
1 parent da52139 commit 5f21022
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cli/src/commands/subgraph/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default (opts: BaseCommandOptions) => {
);
command.option(
'--subscription-protocol <protocol>',
'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse-post.',
'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse_post.',
);
command.option('--readme <path-to-readme>', 'The markdown file which describes the subgraph.');
command.action(async (name, options) => {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/subgraph/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default (opts: BaseCommandOptions) => {
);
command.option(
'--subscription-protocol <protocol>',
'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse-post.',
'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse_post.',
);

command.action(async (name, options) => {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/subgraph/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default (opts: BaseCommandOptions) => {
);
command.option(
'--subscription-protocol <protocol>',
'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse-post.',
'The protocol to use when subscribing to the subgraph. The supported protocols are ws, sse, and sse_post.',
);
command.option('--readme <path-to-readme>', 'The markdown file which describes the subgraph.');

Expand Down
2 changes: 1 addition & 1 deletion composition-go/index.global.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions shared/src/router-config/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface Input {
*
* ws: Negotiates an appropriate protocol over websockets. Both https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md and https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md are supported
* sse: Uses the Server-Sent Events protocol with a GET request
* sse-post: Uses the Server-Sent Events protocol with a POST request
* sse_post: Uses the Server-Sent Events protocol with a POST request
*/
export type SubscriptionProtocol = 'ws' | 'sse' | 'sse_post';

Expand All @@ -59,15 +59,15 @@ export const internString = (config: EngineConfiguration, str: string): Interned
});
};

export const parseGraphQLSubscriptionProtocol = (protocolName: string): GraphQLSubscriptionProtocol => {
export const parseGraphQLSubscriptionProtocol = (protocolName: SubscriptionProtocol): GraphQLSubscriptionProtocol => {
switch (protocolName) {
case 'ws': {
return GraphQLSubscriptionProtocol.GRAPHQL_SUBSCRIPTION_PROTOCOL_WS;
}
case 'sse': {
return GraphQLSubscriptionProtocol.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE;
}
case 'sse-post': {
case 'sse_post': {
return GraphQLSubscriptionProtocol.GRAPHQL_SUBSCRIPTION_PROTOCOL_SSE_POST;
}
}
Expand Down

0 comments on commit 5f21022

Please sign in to comment.