Skip to content

Commit

Permalink
Update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
apollogithubactionsbot[bot] authored and github-actions[bot] committed May 29, 2024
1 parent 20c0808 commit 553f542
Show file tree
Hide file tree
Showing 19 changed files with 359 additions and 189 deletions.
8 changes: 4 additions & 4 deletions docs/client-react-streaming.apolloclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

## ApolloClient class

A version of `ApolloClient` to be used with streaming SSR.
A version of `ApolloClient` to be used with streaming SSR or in React Server Components.

For more documentation, please see [the Apollo Client API documentation](https://www.apollographql.com/docs/react/api/core/ApolloClient)<!-- -->.

**Signature:**

```typescript
declare class ApolloClient<TCacheShape> extends ApolloClient_base<TCacheShape> implements Partial<ApolloClientBrowserImpl<TCacheShape>>, Partial<ApolloClientSSRImpl<TCacheShape>>
declare class ApolloClient<Ignored = NormalizedCacheObject> extends ApolloClient_base implements Partial<ApolloClientBrowserImpl>, Partial<ApolloClientSSRImpl>
```
**Extends:** ApolloClient\_base&lt;TCacheShape&gt;
**Extends:** ApolloClient\_base
**Implements:** Partial&lt;ApolloClientBrowserImpl&lt;TCacheShape&gt;&gt;, Partial&lt;ApolloClientSSRImpl&lt;TCacheShape&gt;&gt;
**Implements:** Partial&lt;ApolloClientBrowserImpl&gt;, Partial&lt;ApolloClientSSRImpl&gt;
49 changes: 49 additions & 0 deletions docs/client-react-streaming.inmemorycache._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@apollo/client-react-streaming](./client-react-streaming.md) &gt; [InMemoryCache](./client-react-streaming.inmemorycache.md) &gt; [(constructor)](./client-react-streaming.inmemorycache._constructor_.md)

## InMemoryCache.(constructor)

Constructs a new instance of the `InMemoryCache` class

**Signature:**

```typescript
constructor(config?: InMemoryCacheConfig | undefined);
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

config


</td><td>

InMemoryCacheConfig \| undefined


</td><td>

_(Optional)_


</td></tr>
</tbody></table>
11 changes: 11 additions & 0 deletions docs/client-react-streaming.inmemorycache._sourcesymbol_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@apollo/client-react-streaming](./client-react-streaming.md) &gt; [InMemoryCache](./client-react-streaming.inmemorycache.md) &gt; [\[sourceSymbol\]](./client-react-streaming.inmemorycache._sourcesymbol_.md)

## InMemoryCache.\[sourceSymbol\] property

**Signature:**

```typescript
[sourceSymbol]: string;
```
75 changes: 75 additions & 0 deletions docs/client-react-streaming.inmemorycache.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,78 @@ declare class InMemoryCache extends InMemoryCache$1
```
**Extends:** InMemoryCache$1
## Constructors
<table><thead><tr><th>
Constructor
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[(constructor)(config)](./client-react-streaming.inmemorycache._constructor_.md)
</td><td>
</td><td>
Constructs a new instance of the `InMemoryCache` class
</td></tr>
</tbody></table>
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[\[sourceSymbol\]](./client-react-streaming.inmemorycache._sourcesymbol_.md)
</td><td>
</td><td>
string
</td><td>
</td></tr>
</tbody></table>
26 changes: 14 additions & 12 deletions docs/client-react-streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Description

</td><td>

A version of `ApolloClient` to be used with streaming SSR.
A version of `ApolloClient` to be used with streaming SSR or in React Server Components.

For more documentation, please see [the Apollo Client API documentation](https://www.apollographql.com/docs/react/api/core/ApolloClient)<!-- -->.

Expand Down Expand Up @@ -141,17 +141,6 @@ Creates a "manual" Data Transport, to be used with `WrapApolloProvider`<!-- -->.
Ensures that you can always access the same instance of ApolloClient during RSC for an ongoing request, while always returning a new instance for different requests.


</td></tr>
<tr><td>

[registerApolloClient(makeClient)](./client-react-streaming.registerapolloclient_1.md)


</td><td>

Ensures that you can always access the same instance of ApolloClient during RSC for an ongoing request, while always returning a new instance for different requests.


</td></tr>
<tr><td>

Expand Down Expand Up @@ -228,6 +217,19 @@ Description



</td></tr>
<tr><td>

[TransportedQueryRef](./client-react-streaming.transportedqueryref.md)


</td><td>

A `TransportedQueryRef` is an opaque object accessible via renderProp within `PreloadQuery`<!-- -->.

A child client component reading the `TransportedQueryRef` via useReadQuery will suspend until the promise resolves.


</td></tr>
<tr><td>

Expand Down
4 changes: 1 addition & 3 deletions docs/client-react-streaming.queryevent.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Events that will be emitted by a wrapped ApolloClient instance during SSR on `Da
```typescript
type QueryEvent = {
type: "started";
options: {
query: string;
} & Omit<WatchQueryOptions, "query">;
options: TransportedOptions;
id: TransportIdentifier;
} | {
type: "data";
Expand Down
12 changes: 7 additions & 5 deletions docs/client-react-streaming.registerapolloclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Ensures that you can always access the same instance of ApolloClient during RSC
**Signature:**

```typescript
declare function registerApolloClient(makeClient: () => Promise<ApolloClient$1<any>>): {
getClient: () => Promise<ApolloClient$1<any>>;
declare function registerApolloClient<ApolloClientOrPromise extends Promise<ApolloClient$1<any>> | ApolloClient$1<any>>(makeClient: () => ApolloClientOrPromise): {
getClient: () => ApolloClientOrPromise;
query: Awaited<ApolloClientOrPromise>["query"];
PreloadQuery: PreloadQueryComponent;
};
```

Expand Down Expand Up @@ -41,7 +43,7 @@ makeClient

</td><td>

() =&gt; Promise&lt;ApolloClient$1&lt;any&gt;&gt;
() =&gt; ApolloClientOrPromise


</td><td>
Expand All @@ -51,13 +53,13 @@ makeClient
</tbody></table>
**Returns:**

{ getClient: () =&gt; Promise&lt;ApolloClient$1&lt;any&gt;&gt;; }
{ getClient: () =&gt; ApolloClientOrPromise; query: Awaited&lt;ApolloClientOrPromise&gt;\["query"\]; PreloadQuery: PreloadQueryComponent; }

## Example


```ts
export const { getClient } = registerApolloClient(() => {
export const { getClient, query, PreloadQuery } = registerApolloClient(() => {
return new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
Expand Down
67 changes: 0 additions & 67 deletions docs/client-react-streaming.registerapolloclient_1.md

This file was deleted.

62 changes: 62 additions & 0 deletions docs/client-react-streaming.transportedqueryref.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@apollo/client-react-streaming](./client-react-streaming.md) &gt; [TransportedQueryRef](./client-react-streaming.transportedqueryref.md)

## TransportedQueryRef interface

A `TransportedQueryRef` is an opaque object accessible via renderProp within `PreloadQuery`<!-- -->.

A child client component reading the `TransportedQueryRef` via useReadQuery will suspend until the promise resolves.

**Signature:**

```typescript
interface TransportedQueryRef<TData = unknown, TVariables = unknown> extends QueryRef<TData, TVariables>
```
**Extends:** QueryRef&lt;TData, TVariables&gt;
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[toPromise?](./client-react-streaming.transportedqueryref.topromise.md)
</td><td>
</td><td>
() =&gt; Promise&lt;[TransportedQueryRef](./client-react-streaming.transportedqueryref.md)<!-- -->&gt;
</td><td>
_(Optional)_ Only available in React Server Components. Will be `undefined` after being passed to Client Components.
Returns a promise that resolves back to the `TransportedQueryRef` that can be awaited in RSC to suspend a subtree until the originating query has been loaded.
</td></tr>
</tbody></table>
Loading

0 comments on commit 553f542

Please sign in to comment.