Skip to content

Commit c8168f7

Browse files
authored
chore: update experimental hooks docs for useBackgroundQuery (#11021)
1 parent 8c0e20c commit c8168f7

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

docs/shared/useBackgroundQuery-options.mdx

+43
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
###### `variables`
2323

2424
`{ [key: string]: any }`
25+
2526
</td>
2627

2728
<td>
@@ -39,6 +40,7 @@ Each key in the object corresponds to a variable name, and that key's value corr
3940
###### `errorPolicy`
4041

4142
`ErrorPolicy`
43+
4244
</td>
4345

4446
<td>
@@ -48,6 +50,7 @@ Specifies how the query handles a response that returns both GraphQL errors and
4850
For details, see [GraphQL error policies](/react/data/error-handling/#graphql-error-policies).
4951

5052
The default value is `none`, which causes the `useReadQuery` hook to throw the error.
53+
5154
</td>
5255
</tr>
5356

@@ -65,6 +68,7 @@ The default value is `none`, which causes the `useReadQuery` hook to throw the e
6568
###### `context`
6669

6770
`Record<string, any>`
71+
6872
</td>
6973

7074
<td>
@@ -80,6 +84,7 @@ If you're using [Apollo Link](/react/api/link/introduction/), this object is the
8084
###### `canonizeResults`
8185

8286
`Boolean`
87+
8388
</td>
8489

8590
<td>
@@ -97,6 +102,7 @@ The default value is `false`.
97102
###### `client`
98103

99104
`ApolloClient`
105+
100106
</td>
101107

102108
<td>
@@ -122,6 +128,7 @@ By default, the instance that's passed down via context is used, but you can pro
122128
###### `fetchPolicy`
123129

124130
`SuspenseQueryHookFetchPolicy`
131+
125132
</td>
126133

127134
<td>
@@ -138,6 +145,42 @@ The default value is `cache-first`.
138145
</td>
139146
</tr>
140147

148+
<tr>
149+
<td>
150+
151+
###### `returnPartialData`
152+
153+
`boolean`
154+
155+
</td>
156+
157+
<td>
158+
159+
If `true`, the query can return _partial_ results from the cache if the cache doesn't contain results for _all_ queried fields.
160+
161+
The default value is `false`.
162+
163+
</td>
164+
</tr>
165+
166+
<tr>
167+
<td>
168+
169+
###### `refetchWritePolicy`
170+
171+
`"merge" | "overwrite"`
172+
173+
</td>
174+
175+
<td>
176+
177+
Watched queries must opt into overwriting existing data on refetch, by passing `refetchWritePolicy: "overwrite"` in their `WatchQueryOptions`.
178+
179+
The default value is `"overwrite"`.
180+
181+
</td>
182+
</tr>
183+
141184
</tbody>
142185

143186
</table>

docs/source/api/react/hooks-experimental.mdx

+2-5
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,8 @@ function useBackgroundQuery<
101101
TData = any,
102102
TVariables extends OperationVariables = OperationVariables
103103
>(
104-
query: query: DocumentNode | TypedDocumentNode<TData, TVariables>,
105-
options: Omit<
106-
SuspenseQueryHookOptions<TData, TVariables>,
107-
'returnPartialData' | 'refetchWritePolicy'
108-
>,
104+
query: DocumentNode | TypedDocumentNode<TData, TVariables>,
105+
options: BackgroundQueryHookOptions<TData, TVariables>,
109106
): UseBackgroundQueryResult<TData> {}
110107
```
111108

0 commit comments

Comments
 (0)