Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

(docs) - Fix various links and upgrade react-static-plugin-md-pages

+29 -28
+11 -11
docs/api/core.md
··· 27 27 | `fetchOptions` | `RequestInit \| () => RequestInit` | Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request | 28 28 | `fetch` | `typeof fetch` | An alternative implementation of `fetch` that will be used by the `fetchExchange` instead of `window.fetch` | 29 29 | `suspense` | `?boolean` | Activates the experimental React suspense mode, which can be used during server-side rendering to prefetch data | 30 - | `requestPolicy` | `?RequestPolicy` | Changes the default request policy that will be used. By default, this will be `cache-first`. | 30 + | `requestPolicy` | `?RequestPolicy` | Changes the default request policy that will be used. By default, this will be `cache-first`. | 31 31 | `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. | 32 32 | `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. | 33 33 ··· 199 199 Some of these options are set when the `Client` is initialised, so in the following list of 200 200 properties you'll likely see some options that exist on the `Client` as well. 201 201 202 - | Prop | Type | Description | 203 - | --------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | 204 - | `fetchOptions` | `?RequestInit \| (() => RequestInit)` | Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request. | 205 - | `fetch` | `typeof fetch` | An alternative implementation of `fetch` that will be used by the `fetchExchange` instead of `window.fetch` | 206 - | `requestPolicy` | `RequestPolicy` | An optional [request policy](/basics/querying-data#request-policy) that should be used specifying the cache strategy. | 207 - | `url` | `string` | The GraphQL endpoint | 208 - | `meta` | `?OperationDebugMeta` | Metadata that is only available in development for devtools. | 209 - | `suspense` | `?boolean` | Whether suspense is enabled. | 210 - | `preferGetMethod` | `?boolean` | Instructs the `fetchExchange` to use HTTP GET for queries. | 211 - | `additionalTypenames` | `?string[]` | Allows you to tell the operation that it depends on certain typenames (used in document-cache.) | 202 + | Prop | Type | Description | 203 + | --------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | 204 + | `fetchOptions` | `?RequestInit \| (() => RequestInit)` | Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request. | 205 + | `fetch` | `typeof fetch` | An alternative implementation of `fetch` that will be used by the `fetchExchange` instead of `window.fetch` | 206 + | `requestPolicy` | `RequestPolicy` | An optional [request policy](../basics/document-caching.md#request-policies) that should be used specifying the cache strategy. | 207 + | `url` | `string` | The GraphQL endpoint | 208 + | `meta` | `?OperationDebugMeta` | Metadata that is only available in development for devtools. | 209 + | `suspense` | `?boolean` | Whether suspense is enabled. | 210 + | `preferGetMethod` | `?boolean` | Instructs the `fetchExchange` to use HTTP GET for queries. | 211 + | `additionalTypenames` | `?string[]` | Allows you to tell the operation that it depends on certain typenames (used in document-cache.) | 212 212 213 213 It also accepts additional, untyped parameters that can be used to send more 214 214 information to custom exchanges.
+1 -1
docs/api/refocus-exchange.md
··· 3 3 order: 11 4 4 --- 5 5 6 - # Refocus exchange 6 + # Refocus Exchange 7 7 8 8 `@urql/exchange-refocus` is an exchange for the `urql` that tracks currently active operations and redispatches them when the 9 9 window regains focus
+4 -4
docs/architecture.md
··· 50 50 new Client({ 51 51 url: '/graphql', 52 52 requestPolicy: 'cache-first', 53 - }) 53 + }); 54 54 ``` 55 55 56 56 The bindings that we've seen in [the "Basics" section](./basics/README.md) interact with [the ··· 128 128 The default set of exchanges that `@urql/core` contains and applies to a `Client` are: 129 129 130 130 - `dedupExchange`: Deduplicates pending operations (pending = waiting for a result) 131 - - `cacheExchange`: The default caching logic with ["Document Caching"](../basics/document-caching.md) 131 + - `cacheExchange`: The default caching logic with ["Document Caching"](./basics/document-caching.md) 132 132 - `fetchExchange`: Sends an operation to the API using `fetch` and adds results to the output stream 133 133 134 134 When we don't pass the `exchanges` option manually to our `Client` then these are the ones that will ··· 147 147 Persisted Queries 148 148 - [`authExchange`](./advanced/authentication.md): Allows complex authentication flows to be implemented 149 149 easily. 150 - - [`requestPolicyExchange`](../api/request-policy-exchange.md): Automatically upgrades `cache-only` and `cache-first` operations to `cache-and-network` after a given amount of time. 151 - - [`refocusExchange`](../api/refocus-exchange.md): Tracks open queries and refetches them 150 + - [`requestPolicyExchange`](./api/request-policy-exchange.md): Automatically upgrades `cache-only` and `cache-first` operations to `cache-and-network` after a given amount of time. 151 + - [`refocusExchange`](./api/refocus-exchange.md): Tracks open queries and refetches them 152 152 when the window regains focus. 153 153 - `devtoolsExchange`: Provides the ability to use the [urql-devtools](https://github.com/FormidableLabs/urql-devtools) 154 154
+2 -2
docs/basics/core.md
··· 179 179 // the default: 180 180 exchanges: defaultExchanges, 181 181 // the same as: 182 - exchanges: [dedupExchange, cacheExchange, fetchExchange] 182 + exchanges: [dedupExchange, cacheExchange, fetchExchange], 183 183 }); 184 184 ``` 185 185 ··· 294 294 event hubs. 295 295 296 296 We're using [the Wonka library for our streams](https://wonka.kitten.sh/basics/background), which 297 - we'll learn more about [on the "Architecture" page](./architecture.md). But we can think of this as 297 + we'll learn more about [on the "Architecture" page](../architecture.md). But we can think of this as 298 298 React's effects being called over time, or as `window.addEventListener`. 299 299 300 300 ## Common Utilities in Core
+4 -3
docs/graphcache/cache-updates.md
··· 6 6 # Cache Updates 7 7 8 8 As we've learned [on the page on "Normalized 9 - Caching"](../normalized-caching.md#normalizing-relational-data), when Graphcache receives an API 9 + Caching"](./normalized-caching.md#normalizing-relational-data), when Graphcache receives an API 10 10 result it will traverse and store all its data to its cache in a normalised structure. Each entity 11 11 that is found in a result will be stored under the entity's key. 12 12 ··· 34 34 than the cache needs to update all affected entities. 35 35 36 36 Previously, we've learned about cache updates [on the "Normalized Caching" 37 - page](normalized-caching/#manual-cache-updates). 37 + page](./normalized-caching.md#manual-cache-updates). 38 38 39 39 The `updates` option on `cacheExchange` accepts a map for `Mutation` or `Subscription` keys on which 40 40 we can add "updater functions" to react to mutation or subscription results. These `updates` ··· 295 295 } 296 296 `; 297 297 298 - const fields = cache.inspectFields('Query') 298 + const fields = cache 299 + .inspectFields('Query') 299 300 .filter(field => field.fieldName === 'todos') 300 301 .forEach(field => { 301 302 cache.updateQuery(
+2 -2
docs/graphcache/offline.md
··· 91 91 92 92 _Graphcache_ applies several mechanisms that improve the consistency of the cache and how it behaves 93 93 when it's used in highly cached-dependent scenarios, including when it's used with its offline 94 - support. We've previously read about some of these guarantees on the ["Under the hood" 95 - page.](./underunder-the-hood.md) 94 + support. We've previously read about some of these guarantees on the ["Normalized Caching" 95 + page.](./normalized-caching.md) 96 96 97 97 While the client is offline, _Graphcache_ will also apply some opinionated mechanisms to queries and 98 98 mutations.
+1 -1
packages/site/package.json
··· 50 50 "react-router-ga": "^1.2.3", 51 51 "react-scroll": "^1.8.1", 52 52 "react-static": "7.2.2", 53 - "react-static-plugin-md-pages": "^0.3.0", 53 + "react-static-plugin-md-pages": "^0.3.2", 54 54 "styled-components": "^5.2.3" 55 55 }, 56 56 "devDependencies": {
+4 -4
yarn.lock
··· 12983 12983 resolved "https://registry.yarnpkg.com/react-ssr-prepass/-/react-ssr-prepass-1.4.0.tgz#33a3db19414f0f8f9f3f781c88f760ae366b4f51" 12984 12984 integrity sha512-0SzdmiQUtHvhxCabHg9BI/pkJfijGkQ0jQL6fC4YFy7idaDOuaiQLsajIkkNxffFXtJFHIWFITlve2WB88e0Jw== 12985 12985 12986 - react-static-plugin-md-pages@^0.3.0: 12987 - version "0.3.0" 12988 - resolved "https://registry.yarnpkg.com/react-static-plugin-md-pages/-/react-static-plugin-md-pages-0.3.0.tgz#a420df0d42a43d387369f8b92d5ab7a27c319a1b" 12989 - integrity sha512-DIBa8pA4LeGU1ioueeO8Yr3F7CVjwg90nBup9A9wNeRIiRz+qkSdlw5Fu86VPkCyxjY4K+xzVbL1JfpMXCMcug== 12986 + react-static-plugin-md-pages@^0.3.2: 12987 + version "0.3.2" 12988 + resolved "https://registry.yarnpkg.com/react-static-plugin-md-pages/-/react-static-plugin-md-pages-0.3.2.tgz#4c2d668eb5721a2ccbb3aa544075ac8583862568" 12989 + integrity sha512-YvZ2MrO9TfkLsXu/lIMKB11ziuRDReT1mGrpOUV6CIYgXHOSACzU7e0VtwWaHq7e5Hz5/J9ACEBrEt24UG/VUg== 12990 12990 dependencies: 12991 12991 "@mdx-js/mdx" "^1.5.5" 12992 12992 "@mdx-js/react" "^1.5.5"