Skip to content

Commit

Permalink
pulll in data
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadid12 committed Apr 17, 2022
1 parent 5f0a824 commit a1caaa4
Show file tree
Hide file tree
Showing 4 changed files with 326 additions and 2 deletions.
25 changes: 25 additions & 0 deletions gqlClient.ts
@@ -0,0 +1,25 @@
import {
ApolloClient,
InMemoryCache,
createHttpLink,
} from '@apollo/client';
import { setContext } from '@apollo/client/link/context';

const httpLink = createHttpLink({
uri: process.env.NEXT_PUBLIC_FAUNA_DOMAIN,
});

const authLink = setContext((_, { headers }) => {
const faunaKey = process.env.NEXT_PUBLIC_FAUNA_KEY;
return {
headers: {
...headers,
authorization: `Bearer ${faunaKey}`,
}
}
});

export const client = new ApolloClient({
link: authLink.concat(httpLink),
cache: new InMemoryCache(),
});

1 comment on commit a1caaa4

@antar37
Copy link

Choose a reason for hiding this comment

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

The changes in _app.tsx didn't seem to be reflected in the video. It should have been in video 5, is that correct?

Please sign in to comment.