Skip to content

Commit

Permalink
Merge branch 'jakob/admin-period-result' of https://github.com/uzh-bf…
Browse files Browse the repository at this point in the history
…/gbl-uzh into jakob/admin-period-result
  • Loading branch information
rschlaefli committed Nov 12, 2024
2 parents b77a012 + ed078bb commit bf04b46
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/platform/src/lib/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ function createIsomorphLink() {
credentials: 'same-origin',
})

if (!process.env.NEXT_PUBLIC_API_URL) {
function createIsomorphLink() {
const isBrowser = typeof window !== 'undefined'

const apiUrl = process.env.NEXT_PUBLIC_API_URL
if (typeof apiUrl !== 'string' || !apiUrl) {
throw new Error('NEXT_PUBLIC_API_URL is not set')
}

let httpLink: ApolloLink = new HttpLink({
uri: apiUrl,
credentials: 'same-origin',
})

// on the client, differentiate between links for query/mutation and subscriptions
if (isBrowser) {
const sseLink = new SSELink({
Expand Down

0 comments on commit bf04b46

Please sign in to comment.