@apollo/client-integration-nextjs
Version:
<div align="center"> <img src="https://raw.githubusercontent.com/apollographql/apollo-client-integrations/main/banner.jpg" width="500" alt="Apollo Client + Next.js App Router" /> </div>
51 lines (48 loc) • 1.68 kB
JavaScript
import { WrapApolloProvider, ApolloClient as ApolloClient$1, InMemoryCache as InMemoryCache$1 } from '@apollo/client-react-streaming';
export { DebounceMultipartResponsesLink, RemoveMultipartDirectivesLink, SSRMultipartLink } from '@apollo/client-react-streaming';
import { useContext } from 'react';
import { buildManualDataTransport, resetManualSSRApolloSingletons } from '@apollo/client-react-streaming/manual-transport';
import { ServerInsertedHTMLContext } from 'next/navigation.js';
// src/index.shared.ts
// src/bundleInfo.ts
var bundle = {
pkg: "@apollo/client-integration-nextjs",
client: "ApolloClient",
cache: "InMemoryCache"
};
var ApolloClient = class extends ApolloClient$1 {
/**
* Information about the current package and it's export names, for use in error messages.
*
* @internal
*/
static info = bundle;
};
var InMemoryCache = class extends InMemoryCache$1 {
/**
* Information about the current package and it's export names, for use in error messages.
*
* @internal
*/
static info = bundle;
};
var ApolloNextAppProvider = /* @__PURE__ */ WrapApolloProvider(
buildManualDataTransport({
useInsertHtml() {
const insertHtml = useContext(ServerInsertedHTMLContext);
if (!insertHtml) {
{
return () => {
};
}
}
return insertHtml;
}
})
);
ApolloNextAppProvider.info = bundle;
var resetApolloClientSingletons = resetManualSSRApolloSingletons;
const built_for_browser = true;
export { ApolloClient, ApolloNextAppProvider, InMemoryCache, built_for_browser, resetApolloClientSingletons };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.browser.js.map