MCPcopy Create free account
hub / github.com/emwalker/digraph / makeClient

Function makeClient

next/lib/ApolloWrapper.tsx:21–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21function makeClient() {
22 const apiOrigin = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8080'
23 const httpLink = new HttpLink({
24 uri: `${apiOrigin}/graphql`,
25 fetchOptions: { cache: 'no-cache' },
26 })
27
28 return new NextSSRApolloClient({
29 cache: new NextSSRInMemoryCache(),
30 link:
31 typeof window === 'undefined'
32 ? ApolloLink.from([
33 new SSRMultipartLink({
34 stripDefer: true,
35 }),
36 httpLink,
37 ])
38 : httpLink,
39 })
40}
41
42export function ApolloWrapper({ children }: React.PropsWithChildren) {
43 return (

Callers

nothing calls this directly

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected