Skip to content

Commit 23130fb

Browse files
committed
Fix default values
1 parent f9ce67a commit 23130fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

javascript_client/src/subscriptions/createActionCableFetcher.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Consumer, Subscription } from "@rails/actioncable"
55
type ActionCableFetcherOptions = {
66
consumer: Consumer,
77
url: string,
8-
channelName = "GraphqlChannel"
8+
channelName?: string,
99
fetch?: typeof fetch,
1010
fetchOptions?: any,
1111
}
@@ -18,8 +18,8 @@ type SubscriptionIteratorPayload = {
1818
export default function createActionCableFetcher(options: ActionCableFetcherOptions) {
1919
let currentChannel: Subscription | null = null
2020
const consumer = options.consumer
21-
const url = options.url
22-
const channelName = options.channelName
21+
const url = options.url || "/graphql"
22+
const channelName = options.channelName || "GraphqlChannel"
2323

2424
const subscriptionFetcher = async function*(graphqlParams: any, fetcherOpts: any) {
2525
let isSubscription = false;

0 commit comments

Comments
 (0)