Skip to content

Commit

Permalink
* fix(websocket.ts): add support for INDEXERS.ahk client to return 'w…
Browse files Browse the repository at this point in the history
…ss://squid.subsquid.io/stick/graphql' as the WebSocket URL
  • Loading branch information
preschian committed Oct 12, 2023
1 parent 45af347 commit c01503c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions utils/websocket.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { INDEXERS } from '@kodadot1/static'
import { apolloClientConfig } from './constants'

export const getWSUrlByClient = (client: string): string | null => {
Expand All @@ -6,5 +7,10 @@ export const getWSUrlByClient = (client: string): string | null => {
return null
}
const { httpEndpoint } = endPoint

if (httpEndpoint === INDEXERS.ahk) {
return 'wss://squid.subsquid.io/stick/graphql'
}

return httpEndpoint.replace('https://', 'wss://').replace('http://', 'wss://')
}

0 comments on commit c01503c

Please sign in to comment.