Next.js Discord

Discord Forum

Implement ApolloProvider but get infinite call size

Unanswered
Ninhache posted this in #help-forum
Open in Discord
I've tried to add the ApolloProvider to my layout but i'm keep getting errors now :
Maximum Call Size..
I've wrap the provider in a client wrapper.. and then we've something like that :
"use client"
export function ApolloWrapper ({ client, children }) {
  return <ApolloProvider client={client}>{children}</ApolloProvider>;
};

and then in the layout
export default function RootLayout({ children, params }) {
  return (
    <html lang={params.lang}>
      <ApolloWrapper client={client}>
        <body className={inter.className}>{children}</body>
      </ApolloWrapper>
    </html>
  );
}

client is defined as follow :

const client = new ApolloClient({
  uri: process.env.BACKEND_URL,
  cache: new InMemoryCache(),
});

0 Replies