Created
February 22, 2022 01:48
-
-
Save klyngen/3d03c6ab4773079f39c128b15e054abc to your computer and use it in GitHub Desktop.
Enkel graphql-klient for å hente data fra sanity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient, InMemoryCache } from '@apollo/client'; | |
import config from '../config'; | |
export const client = new ApolloClient({ | |
uri: `https://${config.SANITY_PROJECT_ID}.apicdn.sanity.io/v1/graphql/${config.SANITY_DATASET}/${config.SANITY_TAG}`, | |
cache: new InMemoryCache(), | |
headers: { | |
Authorization: `Bearer ${config.SANITY_TOKEN}`, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment