···2727| `fetchOptions` | `RequestInit \| () => RequestInit` | Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request |
2828| `fetch` | `typeof fetch` | An alternative implementation of `fetch` that will be used by the `fetchExchange` instead of `window.fetch` |
2929| `suspense` | `?boolean` | Activates the experimental React suspense mode, which can be used during server-side rendering to prefetch data |
3030-| `requestPolicy` | `?RequestPolicy` | Changes the default request policy that will be used. By default, this will be `cache-first`. |
3030+| `requestPolicy` | `?RequestPolicy` | Changes the default request policy that will be used. By default, this will be `cache-first`. |
3131| `preferGetMethod` | `?boolean` | This is picked up by the `fetchExchange` and will force all queries (not mutations) to be sent using the HTTP GET method instead of POST. |
3232| `maskTypename` | `?boolean` | Enables the `Client` to automatically apply the `maskTypename` utility to all `data` on [`OperationResult`s](#operationresult). This makes the `__typename` properties non-enumerable. |
3333···199199Some of these options are set when the `Client` is initialised, so in the following list of
200200properties you'll likely see some options that exist on the `Client` as well.
201201202202-| Prop | Type | Description |
203203-| --------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
204204-| `fetchOptions` | `?RequestInit \| (() => RequestInit)` | Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request. |
205205-| `fetch` | `typeof fetch` | An alternative implementation of `fetch` that will be used by the `fetchExchange` instead of `window.fetch` |
206206-| `requestPolicy` | `RequestPolicy` | An optional [request policy](/basics/querying-data#request-policy) that should be used specifying the cache strategy. |
207207-| `url` | `string` | The GraphQL endpoint |
208208-| `meta` | `?OperationDebugMeta` | Metadata that is only available in development for devtools. |
209209-| `suspense` | `?boolean` | Whether suspense is enabled. |
210210-| `preferGetMethod` | `?boolean` | Instructs the `fetchExchange` to use HTTP GET for queries. |
211211-| `additionalTypenames` | `?string[]` | Allows you to tell the operation that it depends on certain typenames (used in document-cache.) |
202202+| Prop | Type | Description |
203203+| --------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
204204+| `fetchOptions` | `?RequestInit \| (() => RequestInit)` | Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request. |
205205+| `fetch` | `typeof fetch` | An alternative implementation of `fetch` that will be used by the `fetchExchange` instead of `window.fetch` |
206206+| `requestPolicy` | `RequestPolicy` | An optional [request policy](../basics/document-caching.md#request-policies) that should be used specifying the cache strategy. |
207207+| `url` | `string` | The GraphQL endpoint |
208208+| `meta` | `?OperationDebugMeta` | Metadata that is only available in development for devtools. |
209209+| `suspense` | `?boolean` | Whether suspense is enabled. |
210210+| `preferGetMethod` | `?boolean` | Instructs the `fetchExchange` to use HTTP GET for queries. |
211211+| `additionalTypenames` | `?string[]` | Allows you to tell the operation that it depends on certain typenames (used in document-cache.) |
212212213213It also accepts additional, untyped parameters that can be used to send more
214214information to custom exchanges.
+1-1
docs/api/refocus-exchange.md
···33order: 11
44---
5566-# Refocus exchange
66+# Refocus Exchange
7788`@urql/exchange-refocus` is an exchange for the `urql` that tracks currently active operations and redispatches them when the
99window regains focus
+4-4
docs/architecture.md
···5050new Client({
5151 url: '/graphql',
5252 requestPolicy: 'cache-first',
5353-})
5353+});
5454```
55555656The bindings that we've seen in [the "Basics" section](./basics/README.md) interact with [the
···128128The default set of exchanges that `@urql/core` contains and applies to a `Client` are:
129129130130- `dedupExchange`: Deduplicates pending operations (pending = waiting for a result)
131131-- `cacheExchange`: The default caching logic with ["Document Caching"](../basics/document-caching.md)
131131+- `cacheExchange`: The default caching logic with ["Document Caching"](./basics/document-caching.md)
132132- `fetchExchange`: Sends an operation to the API using `fetch` and adds results to the output stream
133133134134When we don't pass the `exchanges` option manually to our `Client` then these are the ones that will
···147147 Persisted Queries
148148- [`authExchange`](./advanced/authentication.md): Allows complex authentication flows to be implemented
149149 easily.
150150-- [`requestPolicyExchange`](../api/request-policy-exchange.md): Automatically upgrades `cache-only` and `cache-first` operations to `cache-and-network` after a given amount of time.
151151-- [`refocusExchange`](../api/refocus-exchange.md): Tracks open queries and refetches them
150150+- [`requestPolicyExchange`](./api/request-policy-exchange.md): Automatically upgrades `cache-only` and `cache-first` operations to `cache-and-network` after a given amount of time.
151151+- [`refocusExchange`](./api/refocus-exchange.md): Tracks open queries and refetches them
152152 when the window regains focus.
153153- `devtoolsExchange`: Provides the ability to use the [urql-devtools](https://github.com/FormidableLabs/urql-devtools)
154154
+2-2
docs/basics/core.md
···179179 // the default:
180180 exchanges: defaultExchanges,
181181 // the same as:
182182- exchanges: [dedupExchange, cacheExchange, fetchExchange]
182182+ exchanges: [dedupExchange, cacheExchange, fetchExchange],
183183});
184184```
185185···294294event hubs.
295295296296We're using [the Wonka library for our streams](https://wonka.kitten.sh/basics/background), which
297297-we'll learn more about [on the "Architecture" page](./architecture.md). But we can think of this as
297297+we'll learn more about [on the "Architecture" page](../architecture.md). But we can think of this as
298298React's effects being called over time, or as `window.addEventListener`.
299299300300## Common Utilities in Core
+4-3
docs/graphcache/cache-updates.md
···66# Cache Updates
7788As we've learned [on the page on "Normalized
99-Caching"](../normalized-caching.md#normalizing-relational-data), when Graphcache receives an API
99+Caching"](./normalized-caching.md#normalizing-relational-data), when Graphcache receives an API
1010result it will traverse and store all its data to its cache in a normalised structure. Each entity
1111that is found in a result will be stored under the entity's key.
1212···3434than the cache needs to update all affected entities.
35353636Previously, we've learned about cache updates [on the "Normalized Caching"
3737-page](normalized-caching/#manual-cache-updates).
3737+page](./normalized-caching.md#manual-cache-updates).
38383939The `updates` option on `cacheExchange` accepts a map for `Mutation` or `Subscription` keys on which
4040we can add "updater functions" to react to mutation or subscription results. These `updates`
···295295 }
296296 `;
297297298298- const fields = cache.inspectFields('Query')
298298+ const fields = cache
299299+ .inspectFields('Query')
299300 .filter(field => field.fieldName === 'todos')
300301 .forEach(field => {
301302 cache.updateQuery(
+2-2
docs/graphcache/offline.md
···91919292_Graphcache_ applies several mechanisms that improve the consistency of the cache and how it behaves
9393when it's used in highly cached-dependent scenarios, including when it's used with its offline
9494-support. We've previously read about some of these guarantees on the ["Under the hood"
9595-page.](./underunder-the-hood.md)
9494+support. We've previously read about some of these guarantees on the ["Normalized Caching"
9595+page.](./normalized-caching.md)
96969797While the client is offline, _Graphcache_ will also apply some opinionated mechanisms to queries and
9898mutations.