Skip to content

Commit 553f542

Browse files
Update Docs
1 parent 20c0808 commit 553f542

19 files changed

+359
-189
lines changed

docs/client-react-streaming.apolloclient.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
## ApolloClient class
66

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

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

1111
**Signature:**
1212

1313
```typescript
14-
declare class ApolloClient<TCacheShape> extends ApolloClient_base<TCacheShape> implements Partial<ApolloClientBrowserImpl<TCacheShape>>, Partial<ApolloClientSSRImpl<TCacheShape>>
14+
declare class ApolloClient<Ignored = NormalizedCacheObject> extends ApolloClient_base implements Partial<ApolloClientBrowserImpl>, Partial<ApolloClientSSRImpl>
1515
```
16-
**Extends:** ApolloClient\_base&lt;TCacheShape&gt;
16+
**Extends:** ApolloClient\_base
1717
18-
**Implements:** Partial&lt;ApolloClientBrowserImpl&lt;TCacheShape&gt;&gt;, Partial&lt;ApolloClientSSRImpl&lt;TCacheShape&gt;&gt;
18+
**Implements:** Partial&lt;ApolloClientBrowserImpl&gt;, Partial&lt;ApolloClientSSRImpl&gt;
1919
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[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)
4+
5+
## InMemoryCache.(constructor)
6+
7+
Constructs a new instance of the `InMemoryCache` class
8+
9+
**Signature:**
10+
11+
```typescript
12+
constructor(config?: InMemoryCacheConfig | undefined);
13+
```
14+
15+
## Parameters
16+
17+
<table><thead><tr><th>
18+
19+
Parameter
20+
21+
22+
</th><th>
23+
24+
Type
25+
26+
27+
</th><th>
28+
29+
Description
30+
31+
32+
</th></tr></thead>
33+
<tbody><tr><td>
34+
35+
config
36+
37+
38+
</td><td>
39+
40+
InMemoryCacheConfig \| undefined
41+
42+
43+
</td><td>
44+
45+
_(Optional)_
46+
47+
48+
</td></tr>
49+
</tbody></table>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[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)
4+
5+
## InMemoryCache.\[sourceSymbol\] property
6+
7+
**Signature:**
8+
9+
```typescript
10+
[sourceSymbol]: string;
11+
```

docs/client-react-streaming.inmemorycache.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,78 @@ declare class InMemoryCache extends InMemoryCache$1
1515
```
1616
**Extends:** InMemoryCache$1
1717
18+
## Constructors
19+
20+
<table><thead><tr><th>
21+
22+
Constructor
23+
24+
25+
</th><th>
26+
27+
Modifiers
28+
29+
30+
</th><th>
31+
32+
Description
33+
34+
35+
</th></tr></thead>
36+
<tbody><tr><td>
37+
38+
[(constructor)(config)](./client-react-streaming.inmemorycache._constructor_.md)
39+
40+
41+
</td><td>
42+
43+
44+
</td><td>
45+
46+
Constructs a new instance of the `InMemoryCache` class
47+
48+
49+
</td></tr>
50+
</tbody></table>
51+
52+
## Properties
53+
54+
<table><thead><tr><th>
55+
56+
Property
57+
58+
59+
</th><th>
60+
61+
Modifiers
62+
63+
64+
</th><th>
65+
66+
Type
67+
68+
69+
</th><th>
70+
71+
Description
72+
73+
74+
</th></tr></thead>
75+
<tbody><tr><td>
76+
77+
[\[sourceSymbol\]](./client-react-streaming.inmemorycache._sourcesymbol_.md)
78+
79+
80+
</td><td>
81+
82+
83+
</td><td>
84+
85+
string
86+
87+
88+
</td><td>
89+
90+
91+
</td></tr>
92+
</tbody></table>

docs/client-react-streaming.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Description
2828

2929
</td><td>
3030

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

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

@@ -141,17 +141,6 @@ Creates a "manual" Data Transport, to be used with `WrapApolloProvider`<!-- -->.
141141
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.
142142

143143

144-
</td></tr>
145-
<tr><td>
146-
147-
[registerApolloClient(makeClient)](./client-react-streaming.registerapolloclient_1.md)
148-
149-
150-
</td><td>
151-
152-
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.
153-
154-
155144
</td></tr>
156145
<tr><td>
157146

@@ -228,6 +217,19 @@ Description
228217

229218

230219

220+
</td></tr>
221+
<tr><td>
222+
223+
[TransportedQueryRef](./client-react-streaming.transportedqueryref.md)
224+
225+
226+
</td><td>
227+
228+
A `TransportedQueryRef` is an opaque object accessible via renderProp within `PreloadQuery`<!-- -->.
229+
230+
A child client component reading the `TransportedQueryRef` via useReadQuery will suspend until the promise resolves.
231+
232+
231233
</td></tr>
232234
<tr><td>
233235

docs/client-react-streaming.queryevent.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ Events that will be emitted by a wrapped ApolloClient instance during SSR on `Da
1111
```typescript
1212
type QueryEvent = {
1313
type: "started";
14-
options: {
15-
query: string;
16-
} & Omit<WatchQueryOptions, "query">;
14+
options: TransportedOptions;
1715
id: TransportIdentifier;
1816
} | {
1917
type: "data";

docs/client-react-streaming.registerapolloclient.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ Ensures that you can always access the same instance of ApolloClient during RSC
1111
**Signature:**
1212

1313
```typescript
14-
declare function registerApolloClient(makeClient: () => Promise<ApolloClient$1<any>>): {
15-
getClient: () => Promise<ApolloClient$1<any>>;
14+
declare function registerApolloClient<ApolloClientOrPromise extends Promise<ApolloClient$1<any>> | ApolloClient$1<any>>(makeClient: () => ApolloClientOrPromise): {
15+
getClient: () => ApolloClientOrPromise;
16+
query: Awaited<ApolloClientOrPromise>["query"];
17+
PreloadQuery: PreloadQueryComponent;
1618
};
1719
```
1820

@@ -41,7 +43,7 @@ makeClient
4143

4244
</td><td>
4345

44-
() =&gt; Promise&lt;ApolloClient$1&lt;any&gt;&gt;
46+
() =&gt; ApolloClientOrPromise
4547

4648

4749
</td><td>
@@ -51,13 +53,13 @@ makeClient
5153
</tbody></table>
5254
**Returns:**
5355

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

5658
## Example
5759

5860

5961
```ts
60-
export const { getClient } = registerApolloClient(() => {
62+
export const { getClient, query, PreloadQuery } = registerApolloClient(() => {
6163
return new ApolloClient({
6264
cache: new InMemoryCache(),
6365
link: new HttpLink({

docs/client-react-streaming.registerapolloclient_1.md

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@apollo/client-react-streaming](./client-react-streaming.md) &gt; [TransportedQueryRef](./client-react-streaming.transportedqueryref.md)
4+
5+
## TransportedQueryRef interface
6+
7+
A `TransportedQueryRef` is an opaque object accessible via renderProp within `PreloadQuery`<!-- -->.
8+
9+
A child client component reading the `TransportedQueryRef` via useReadQuery will suspend until the promise resolves.
10+
11+
**Signature:**
12+
13+
```typescript
14+
interface TransportedQueryRef<TData = unknown, TVariables = unknown> extends QueryRef<TData, TVariables>
15+
```
16+
**Extends:** QueryRef&lt;TData, TVariables&gt;
17+
18+
## Properties
19+
20+
<table><thead><tr><th>
21+
22+
Property
23+
24+
25+
</th><th>
26+
27+
Modifiers
28+
29+
30+
</th><th>
31+
32+
Type
33+
34+
35+
</th><th>
36+
37+
Description
38+
39+
40+
</th></tr></thead>
41+
<tbody><tr><td>
42+
43+
[toPromise?](./client-react-streaming.transportedqueryref.topromise.md)
44+
45+
46+
</td><td>
47+
48+
49+
</td><td>
50+
51+
() =&gt; Promise&lt;[TransportedQueryRef](./client-react-streaming.transportedqueryref.md)<!-- -->&gt;
52+
53+
54+
</td><td>
55+
56+
_(Optional)_ Only available in React Server Components. Will be `undefined` after being passed to Client Components.
57+
58+
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.
59+
60+
61+
</td></tr>
62+
</tbody></table>

0 commit comments

Comments
 (0)