import React from 'react'; import type { ApolloClientOptions, ApolloLink, HttpOptions, InMemoryCacheConfig, setLogVerbosity } from '@apollo/client'; import { InMemoryCache } from '@apollo/client-react-streaming'; import type { UseAuth } from '@redwoodjs/auth'; import './typeOverride.js'; import type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks } from './links.js'; export type ApolloClientCacheConfig = InMemoryCacheConfig; export type { RedwoodApolloLink, RedwoodApolloLinkFactory, RedwoodApolloLinkName, RedwoodApolloLinks, }; export type GraphQLClientConfigProp = Omit, 'cache' | 'link'> & { cache?: InMemoryCache; /** * Configuration for Apollo Client's `InMemoryCache`. * See https://www.apollographql.com/docs/react/caching/cache-configuration/. */ cacheConfig?: ApolloClientCacheConfig; /** * Configuration for the terminating `HttpLink`. * See https://www.apollographql.com/docs/react/api/link/apollo-link-http/#httplink-constructor-options. * * For example, you can use this prop to set the credentials policy so that cookies can be sent to other domains: * * ```js * * ``` */ httpLinkConfig?: HttpOptions; /** * Extend or overwrite `RedwoodApolloProvider`'s Apollo Link. * * To overwrite Redwood's Apollo Link, just provide your own `ApolloLink`. * * To extend Redwood's Apollo Link, provide a function—it'll get passed an array of Redwood's Apollo Links * which are objects with a name and link property: * * ```js * const link = (redwoodApolloLinks) => { * const consoleLink = new ApolloLink((operation, forward) => { * console.log(operation.operationName) * return forward(operation) * }) * * return ApolloLink.from([consoleLink, ...redwoodApolloLinks.map(({ link }) => link)]) * } * ``` * * If you do this, there's a few things you should keep in mind: * - your function should return a single link (e.g., using `ApolloLink.from`; see https://www.apollographql.com/docs/react/api/link/introduction/#additive-composition) * - the `HttpLink` should come last (https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link) */ link?: ApolloLink | RedwoodApolloLinkFactory; }; export declare const RedwoodApolloProvider: React.FunctionComponent<{ graphQLClientConfig?: GraphQLClientConfigProp; useAuth?: UseAuth; logLevel?: ReturnType; children: React.ReactNode; }>; //# sourceMappingURL=suspense.d.ts.map