Skip to content

Commit

Permalink
fix(apollo): removes domain from client uri
Browse files Browse the repository at this point in the history
removes the domain part of the apollo client uri, just to use
a relative uri instead

fixes #160
  • Loading branch information
anguspiv committed Mar 1, 2023
1 parent 98ce801 commit 5c8d795
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 58 deletions.
7 changes: 1 addition & 6 deletions src/utils/apollo-client.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { ApolloClient, InMemoryCache, from } from '@apollo/client';
import { createUploadLink } from 'apollo-upload-client';
import { getSession } from 'next-auth/react';
import { getBaseUrl } from '@utils/getBaseUrl';
import logger from '@utils/logger';
import { ContextSetter, setContext } from '@apollo/client/link/context';
import { AuthSession } from '../../pages/api/auth/[...nextauth]';

const BASE_URL = getBaseUrl();
const uri = `${BASE_URL}/api/graphql`;

logger.info(`Base URL: ${BASE_URL}\n GraphQL uri: ${uri}`);
const uri = `/api/graphql`;

const httpLink = createUploadLink({ uri, credentials: 'include' });

Expand Down
43 changes: 0 additions & 43 deletions src/utils/getBaseUrl.test.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/utils/getBaseUrl.ts

This file was deleted.

1 comment on commit 5c8d795

@vercel
Copy link

@vercel vercel bot commented on 5c8d795 Mar 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.