···59596060Talking about increasing the `delay` randomly, `randomDelay` allows us to disable this. When this option is set to `false` we'll only increase the time between attempts with the `initialDelayMs`. This means if we fail the first time we'll have 1 second wait, next fail we'll have 2 seconds and so on.
61616262-We don't want to infinitley attempt an `operation`, we can declare how many times it should attempt the `operation` with `maxNumberAttempts`.
6262+We don't want to infinitely attempt an `operation`, we can declare how many times it should attempt the `operation` with `maxNumberAttempts`.
63636464[For more information on the available options check out the API Docs.](../api/retry-exchange.md)
6565
+3-9
docs/advanced/server-side-rendering.md
···1818To start out with the `ssrExchange` we have to add the exchange to our `Client`:
19192020```js
2121-import {
2222- createClient,
2323- dedupExchange,
2424- cacheExchange,
2525- fetchExchange,
2626- ssrExchange
2727-} from '@urql/core';
2121+import { createClient, dedupExchange, cacheExchange, fetchExchange, ssrExchange } from '@urql/core';
28222923const isServerSide = typeof window === 'undefined';
3024···4034 cacheExchange,
4135 ssr, // Add `ssr` in front of the `fetchExchange`
4236 fetchExchange,
4343- ]
3737+ ],
4438});
4539```
4640···4842option tells the exchange whether it's on the server- or client-side. In our example we use `typeof window` to determine this, but in Webpack environments you may also be able to use `process.browser`.
49435044The `initialState` option should be set to the serialized data you retrieve on your server-side.
5151-This data may be retrieved using methods on `ssrExchange()`. You can retrive the serialized data
4545+This data may be retrieved using methods on `ssrExchange()`. You can retrieve the serialized data
5246after server-side rendering using `ssr.extractData()`:
53475448```js
+4-4
docs/advanced/testing.md
···13131414## Mocking the client
15151616-For the most part, Urql's hooks are just adapters for talking to the Urql client.
1616+For the most part, urql's hooks are just adapters for talking to the urql client.
17171818The way in which they do this is by making calls to the client via context.
1919···2121- `useMutation` calls `executeMutation`
2222- `useSubscription` calls `executeSubscription`
23232424-In the section [Stream Patterns](../concepts/stream-patterns.md) we've seen, that all methods on the client operate with and return streams. These streams are created using the `wonka` library and we're able to create streams ourselves to mock the different states of our operations, e.g. fetching, errors, or success with data.
2424+In the section [Stream Patterns](../concepts/stream-patterns.md) we've seen, that all methods on the client operate with and return streams. These streams are created using the [Wonka](../concepts/stream-patterns.md#the-wonka-library) library and we're able to create streams ourselves to mock the different states of our operations, e.g. fetching, errors, or success with data.
25252626You'll probably use one of these utility functions to create streams:
2727···184184185185## Subscriptions
186186187187-Testing subscriptions can be done by simulating the arrival of new data over time. To do this we may use the `interval` utility from `wonka`, which emits values on a timer, and for each value we can map over the response that we'd like to mock.
187187+Testing subscriptions can be done by simulating the arrival of new data over time. To do this we may use the `interval` utility from Wonka, which emits values on a timer, and for each value we can map over the response that we'd like to mock.
188188189189-If you prefer to have more control on when the new data is arriving you can use the `makeSubject` utility from `wonka`. You can see more details in the next section.
189189+If you prefer to have more control on when the new data is arriving you can use the `makeSubject` utility from Wonka. You can see more details in the next section.
190190191191Here's an example of testing a list component which uses a subscription.
192192
+10-10
docs/api/core.md
···114114115115## CombinedError
116116117117-The `CominedError` is used in `urql` to normalize network errors and `GraphQLError`s if anything
117117+The `CombinedError` is used in `urql` to normalize network errors and `GraphQLError`s if anything
118118goes wrong during a GraphQL request.
119119120120-| Input | Type | Description |
121121-| ------------- | -------------------------------- | --------------------------------------------------------------------------------- |
122122-| networkError | `?Error` | An unexpected error that might've occured when trying to send the GraphQL request |
123123-| graphQLErrors | `?Array<string \| GraphQLError>` | GraphQL Errors (if any) that were returned by the GraphQL API |
124124-| response | `?any` | The raw response object (if any) from the `fetch` call |
120120+| Input | Type | Description |
121121+| ------------- | -------------------------------- | ---------------------------------------------------------------------------------- |
122122+| networkError | `?Error` | An unexpected error that might've occurred when trying to send the GraphQL request |
123123+| graphQLErrors | `?Array<string \| GraphQLError>` | GraphQL Errors (if any) that were returned by the GraphQL API |
124124+| response | `?any` | The raw response object (if any) from the `fetch` call |
125125126126[Read more about errors in `urql` on the "Error" page.](../basics/errors.md)
127127···139139| variables | `?object` | The variables to be used with the GraphQL request. |
140140141141The `key` property is a hash of both the `query` and the `variables`, to uniquely
142142-identify the request. When `variables` are passed it is ensured that they're stabily stringified so
142142+identify the request. When `variables` are passed it is ensured that they're stably stringified so
143143that the same variables in a different order will result in the same `key`, since variables are
144144order-independent in GraphQL.
145145···197197198198| Prop | Type | Description |
199199| ------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
200200-| fetchOptions | `?RequestInit \| (() => RequestInit)` |Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request. |
200200+| fetchOptions | `?RequestInit \| (() => RequestInit)` | Additional `fetchOptions` that `fetch` in `fetchExchange` should use to make a request. |
201201| fetch | `typeof fetch` | An alternative implementation of `fetch` that will be used by the `fetchExchange` instead of `window.fetch` |
202202| requestPolicy | `RequestPolicy` | An optional [request policy](/basics/querying-data#request-policy) that should be used specifying the cache strategy. |
203203| url | `string` | The GraphQL endpoint |
···231231| Input | Type | Description |
232232| ------- | ------------ | ----------------------------------------------------------------------------------------------------------------------- |
233233| forward | `ExchangeIO` | The unction responsible for receiving an observable operation and returning a result |
234234-| client | `Client` | The URQL application-wide client library. Each execute method starts a GraphQL request and returns a stream of results. |
234234+| client | `Client` | The urql application-wide client library. Each execute method starts a GraphQL request and returns a stream of results. |
235235236236### Exchange
237237···334334### stringifyVariables
335335336336This function is a variation of `JSON.stringify` that sorts any object's keys that is being
337337-stringified to ensure that two objects with a different order of keys will be stabily stringified to
337337+stringified to ensure that two objects with a different order of keys will be stably stringified to
338338the same string.
339339340340```js
+5-5
docs/api/graphcache.md
···415415Accepts a single object of optional options and returns a resolver that can be inserted into the
416416[`cacheExchange`'s](#cacheexchange) [`resolvers` configuration.](#resolvers-option)
417417418418-| Argument | Type | Description |
419419-| -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
420420-| offsetArgument | `?string` | The field arguments's property, as passed to the resolver, that contains the current offset, i.e. the number of items to be skipped. Defaults to `'skip'`. |
421421-| limitArgument | `?string` | The field arguments's property, as passed to the resolver, that contains the current page size limit, i.e. the number of items on each page. Defaults to `'limit'`. |
418418+| Argument | Type | Description |
419419+| -------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
420420+| offsetArgument | `?string` | The field arguments' property, as passed to the resolver, that contains the current offset, i.e. the number of items to be skipped. Defaults to `'skip'`. |
421421+| limitArgument | `?string` | The field arguments' property, as passed to the resolver, that contains the current page size limit, i.e. the number of items on each page. Defaults to `'limit'`. |
422422423423Once set up, the resulting resolver is able to automatically concatenate all pages of a given field
424424automatically. Queries to this resolvers will from then on only return the infinite, combined list
···434434435435| Argument | Type | Description |
436436| --------- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
437437-| mergeMode | `'outwards' \| 'inwards'` | With Relay pagination, pages can be queried forwards and backwards using `after` and `before` cursors. This option defines whether pages that have been quiered backwards should be concatenated before (outwards) or after (inwards) all pages that have been queried forwards. |
437437+| mergeMode | `'outwards' \| 'inwards'` | With Relay pagination, pages can be queried forwards and backwards using `after` and `before` cursors. This option defines whether pages that have been queried backwards should be concatenated before (outwards) or after (inwards) all pages that have been queried forwards. |
438438439439Once set up, the resulting resolver is able to automatically concatenate all pages of a given field
440440automatically. Queries to this resolvers will from then on only return the infinite, combined list
+1-1
docs/basics/errors.md
···23232424
25252626-It's worth noting that an `error` can coexit and be returned in a successful request alongside
2626+It's worth noting that an `error` can coexist and be returned in a successful request alongside
2727`data`. This is because in GraphQL a query can have partially failed but still contain some data.
2828In that case `CombinedError` will be passed to us with `graphQLErrors`, while `data` may still be
2929set.
+1-1
docs/concepts/core-package.md
···1616## Background
17171818The ["Philosophy"](./philosophy.md) page explains how `urql` solves some of problems encountered when different aspects
1919-of having a GraphQL client handle declarative querying and being a central point of extensibiliy.
1919+of having a GraphQL client handle declarative querying and being a central point of extensibility.
20202121By extension there are three parts of `urql` you'll come in contact with when you add it to your
2222app:
+3-3
docs/concepts/exchanges.md
···44444545The first parameter to an exchange is a `forward` function that refers to the next Exchange in the
4646chain. The second second parameter is the `Client` being used. Exchanges always return an `ExchangeIO`
4747-function (this applies to the `forward` funtion as well), which accepts the source of
4747+function (this applies to the `forward` function as well), which accepts the source of
4848[_Operations_](../api/core.md#operation) and returns a source of [_Operation
4949Results_](../api/core.md#operationresult).
5050···5454## Using Exchanges
55555656The `Client` accepts an `exchanges` option that defaults to the three default exchanges mentioned above. When we pass a custom list of exchanges the `Client` uses the `composeExchanges`
5757-utiliy, which starts chaining these exchanges.
5757+utility, which starts chaining these exchanges.
58585959In essence these exchanges build a pipeline that runs in the order they're passed; _Operations_ flow
6060in from the start to the end, and _Results_ are returned through the chain in reverse.
···6363`fetchExchange` — an incoming operation is treated as follows:
64646565**First,** ongoing operations are deduplicated. It wouldn't make sense to send the
6666-same operation / request twice in parralel.
6666+same operation / request twice in parallel.
67676868**Second,** operations are checked against the cache. Depending on the `requestPolicy`,
6969cached results can be resolved instead and results from network requests are cached.
+2-2
docs/concepts/philosophy.md
···3232});
3333```
34343535-In `urql`, the client is the first step towards manging the complexity of GraphQL automatically.
3535+In `urql`, the client is the first step towards managing the complexity of GraphQL automatically.
36363737## Using GraphQL Clients
3838···93939494## Extensibility and Integration
95959696-With any kind of API there can be concerns outside of caching and state mangagement. For example,
9696+With any kind of API there can be concerns outside of caching and state management. For example,
9797the global behavior or business logic of your application. For instance, you may want to add authentication, retry-logic for failed requests, or a global
9898error handler.
9999
+1-1
exchanges/graphcache/help.md
···2233**This document lists out all errors and warnings in `@urql/exchange-graphcache`.**
4455-Any unexpected behaviour, conditon, or error will be marked by an error or warning
55+Any unexpected behaviour, condition, or error will be marked by an error or warning
66in development, which will output a helpful little message. Sometimes however, this
77message may not actually tell you everything about what's going on.
88
+1-1
packages/core/src/client.test.ts
···11import { print } from 'graphql';
22import gql from 'graphql-tag';
3344-/** NOTE: Testing in this file is designed to test both the client and it's interaction with default Exchanges */
44+/** NOTE: Testing in this file is designed to test both the client and its interaction with default Exchanges */
5566import { map, pipe, subscribe, filter, toArray, tap } from 'wonka';
77import { Exchange, Operation, OperationResult } from './types';
+1-1
packages/site/src/screens/home/_content.js
···3535 media: '',
3636 },
3737 getStarted: {
3838- description: `With it's intiuitive set of lightweight API's, getting started with urql is a breeze. Dive into the documentation to get up and running in minutes.`,
3838+ description: `With its intuitive set of lightweight API's, getting started with urql is a breeze. Dive into the documentation to get up and running in minutes.`,
3939 link: '/docs',
4040 },
4141 oss: [