GraphQL
We use and suggest
Apollo GraphQL
Apollo GraphQL

Connecting @apollo/client

1
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
2
3
const tetsnet = 'https://mintbase-testnet.hasura.app/v1/graphql'
4
///const mainnet = https://mintbase-mainnet.hasura.app/v1/graphql
5
6
function createApolloClient(graphUri: string) {
7
return new ApolloClient({
8
ssrMode: typeof window === 'undefined',
9
link: new HttpLink({
10
uri: tetsnet,
11
credentials: 'same-origin',
12
headers: {
13
'x-hasura-role': 'anonymous',
14
},
15
}),
16
cache: new InMemoryCache(),
17
})
18
}
Copied!
Last modified 2mo ago
Copy link