Skip to content

Commit

Permalink
window not defined on build
Browse files Browse the repository at this point in the history
  • Loading branch information
Robonau committed Dec 9, 2023
1 parent c058794 commit c0ed758
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ const httpLink = createUploadLink({ uri: '/api/graphql' }) as unknown as ApolloL

let splitLink: ApolloLink = httpLink;

const url = window.location.origin
? window.location.origin.replace(/^http/, 'ws') + '/api/graphql'
: 'http://tachidesk:4567';
let url = 'http://tachidesk:4567';
if (typeof window !== 'undefined') {
url = window.location.origin.replace(/^http/, 'ws') + '/api/graphql';
}

try {
const wsLink = new GraphQLWsLink(
Expand Down

0 comments on commit c0ed758

Please sign in to comment.