@apollo/client-react-streaming
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -98,5 +98,48 @@ import * as _apollo_client_index_js from '@apollo/client/index.js'; | ||
}; | ||
/** | ||
* Props for `PreloadQueryComponent` | ||
* @see {@link PreloadQueryComponent} | ||
* @public | ||
*/ | ||
interface PreloadQueryProps<TData, TVariables> extends PreloadQueryOptions<TVariables, TData> { | ||
children: ReactNode | ((queryRef: TransportedQueryRef<NoInfer<TData>, NoInfer<TVariables>>) => ReactNode); | ||
} | ||
/** | ||
* Preloads data in React Server Components to be hydrated | ||
* in Client Components. | ||
* | ||
* ### Example with `queryRef` | ||
* `ClientChild` would call `useReadQuery` with the `queryRef`, the `Suspense` boundary is optional: | ||
* ```jsx | ||
* <PreloadQuery | ||
* query={QUERY} | ||
* variables={{ | ||
* foo: 1 | ||
* }} | ||
* > | ||
* {(queryRef) => ( | ||
* <Suspense fallback={<>loading</>}> | ||
* <ClientChild queryRef={queryRef} /> | ||
* </Suspense> | ||
* )} | ||
* </PreloadQuery> | ||
* ``` | ||
* | ||
* ### Example for `useSuspenseQuery` | ||
* `ClientChild` would call the same query with `useSuspenseQuery`, the `Suspense` boundary is optional: | ||
* ```jsx | ||
* <PreloadQuery | ||
* query={QUERY} | ||
* variables={{ | ||
* foo: 1 | ||
* }} | ||
* > | ||
* <Suspense fallback={<>loading</>}> | ||
* <ClientChild /> | ||
* </Suspense> | ||
* </PreloadQuery> | ||
* ``` | ||
* | ||
* @public | ||
*/ | ||
interface PreloadQueryComponent { | ||
@@ -498,2 +541,2 @@ <TData, TVariables extends OperationVariables>(props: PreloadQueryProps<TData, TVariables>): React.ReactElement; | ||
export { ApolloClient, DataTransportContext, type DataTransportProviderImplementation, AccumulateMultipartResponsesLink as DebounceMultipartResponsesLink, InMemoryCache, type QueryEvent, RemoveMultipartDirectivesLink, SSRMultipartLink, type TransportedQueryRef, WrapApolloProvider, type WrappedApolloProvider, registerApolloClient, resetApolloSingletons }; | ||
export { ApolloClient, DataTransportContext, type DataTransportProviderImplementation, AccumulateMultipartResponsesLink as DebounceMultipartResponsesLink, InMemoryCache, type PreloadQueryComponent, type PreloadQueryProps, type QueryEvent, RemoveMultipartDirectivesLink, SSRMultipartLink, type TransportedQueryRef, WrapApolloProvider, type WrappedApolloProvider, registerApolloClient, resetApolloSingletons }; |
@@ -98,5 +98,48 @@ import * as _apollo_client_index_js from '@apollo/client/index.js'; | ||
}; | ||
/** | ||
* Props for `PreloadQueryComponent` | ||
* @see {@link PreloadQueryComponent} | ||
* @public | ||
*/ | ||
interface PreloadQueryProps<TData, TVariables> extends PreloadQueryOptions<TVariables, TData> { | ||
children: ReactNode | ((queryRef: TransportedQueryRef<NoInfer<TData>, NoInfer<TVariables>>) => ReactNode); | ||
} | ||
/** | ||
* Preloads data in React Server Components to be hydrated | ||
* in Client Components. | ||
* | ||
* ### Example with `queryRef` | ||
* `ClientChild` would call `useReadQuery` with the `queryRef`, the `Suspense` boundary is optional: | ||
* ```jsx | ||
* <PreloadQuery | ||
* query={QUERY} | ||
* variables={{ | ||
* foo: 1 | ||
* }} | ||
* > | ||
* {(queryRef) => ( | ||
* <Suspense fallback={<>loading</>}> | ||
* <ClientChild queryRef={queryRef} /> | ||
* </Suspense> | ||
* )} | ||
* </PreloadQuery> | ||
* ``` | ||
* | ||
* ### Example for `useSuspenseQuery` | ||
* `ClientChild` would call the same query with `useSuspenseQuery`, the `Suspense` boundary is optional: | ||
* ```jsx | ||
* <PreloadQuery | ||
* query={QUERY} | ||
* variables={{ | ||
* foo: 1 | ||
* }} | ||
* > | ||
* <Suspense fallback={<>loading</>}> | ||
* <ClientChild /> | ||
* </Suspense> | ||
* </PreloadQuery> | ||
* ``` | ||
* | ||
* @public | ||
*/ | ||
interface PreloadQueryComponent { | ||
@@ -405,2 +448,2 @@ <TData, TVariables extends OperationVariables>(props: PreloadQueryProps<TData, TVariables>): React.ReactElement; | ||
export { ApolloClient, AccumulateMultipartResponsesLink as DebounceMultipartResponsesLink, InMemoryCache, RemoveMultipartDirectivesLink, SSRMultipartLink, type TransportedQueryRef, registerApolloClient }; | ||
export { ApolloClient, AccumulateMultipartResponsesLink as DebounceMultipartResponsesLink, InMemoryCache, type PreloadQueryComponent, type PreloadQueryProps, RemoveMultipartDirectivesLink, SSRMultipartLink, type TransportedQueryRef, registerApolloClient }; |
{ | ||
"name": "@apollo/client-react-streaming", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "url": "git+https://github.com/apollographql/apollo-client-nextjs" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1173338
10331