{"path":"docs/api","templateID":1,"sharedPropsHashes":{"sidebarHeaders":"Z2g2wgG"},"localProps":{"title":"API","path":"/api/","renderedMd":"<p><a name=\"api\"></a></p>\n\n        <h1>\n          API\n        </h1>\n      \n\n            <h2>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"react-components-and-hooks\"\n                href=\"#react-components-and-hooks\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              React components and hooks\n            </h2>\n          \n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"usequery-hook\"\n                href=\"#usequery-hook\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              useQuery (hook)\n            </h3>\n          \n<p>Accepts a single options object as input:</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">interface</span> <span class=\"token class-name\">UseQueryArgs</span> <span class=\"token punctuation\">{</span>\n  query<span class=\"token punctuation\">:</span> string<span class=\"token punctuation\">;</span>\n  variables<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> any<span class=\"token punctuation\">;</span>\n  requestPolicy<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> RequestPolicy<span class=\"token punctuation\">;</span>\n  pause<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> boolean<span class=\"token punctuation\">;</span>\n  pollInterval<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> number<span class=\"token punctuation\">;</span>\n  context<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> Partial<span class=\"token operator\">&lt;</span>OperationContext<span class=\"token operator\">></span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>And returns a tuple of the current query's state and\nan <code class=\"language-text\">executeQuery</code> function.</p>\n<p>The current state's shape is:</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">interface</span> <span class=\"token class-name\">UseQueryState</span><span class=\"token operator\">&lt;</span><span class=\"token constant\">T</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n  fetching<span class=\"token punctuation\">:</span> boolean<span class=\"token punctuation\">;</span>\n  data<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> <span class=\"token constant\">T</span><span class=\"token punctuation\">;</span>\n  error<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> CombinedError<span class=\"token punctuation\">;</span>\n  extensions<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> Record<span class=\"token operator\">&lt;</span>string<span class=\"token punctuation\">,</span> any<span class=\"token operator\">></span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>And the <code class=\"language-text\">executeQuery</code> function optionally\naccepts a partial <code class=\"language-text\">OperationContext</code>.</p>\n<p><a href=\"https://formidable.com/open-source/urql/docs/getting-started#writing-queries\">More information on how to use this hook can be found in the Getting Started section.</a></p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"usemutation-hook\"\n                href=\"#usemutation-hook\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              useMutation (hook)\n            </h3>\n          \n<p>Accepts a single <code class=\"language-text\">query</code> argument of type <code class=\"language-text\">string</code>. And returns the\ncurrent mutation's state and an <code class=\"language-text\">executeMutation</code> function in a tuple. The\nmutation is not started unless <code class=\"language-text\">executeMutation</code> has been called.</p>\n<p>The use of the state is optional as <code class=\"language-text\">executeMutation</code> returns promise\nresolving to the <code class=\"language-text\">OperationResult</code> itself.</p>\n<p>The current mutation state's shape is:</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">interface</span> <span class=\"token class-name\">UseMutationState</span><span class=\"token operator\">&lt;</span><span class=\"token constant\">T</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n  fetching<span class=\"token punctuation\">:</span> boolean<span class=\"token punctuation\">;</span>\n  data<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> <span class=\"token constant\">T</span><span class=\"token punctuation\">;</span>\n  error<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> CombinedError<span class=\"token punctuation\">;</span>\n  extensions<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> Record<span class=\"token operator\">&lt;</span>string<span class=\"token punctuation\">,</span> any<span class=\"token operator\">></span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>The <code class=\"language-text\">executeMutation</code> function accepts the <code class=\"language-text\">variables</code> of type <code class=\"language-text\">object</code> and\nan optional <code class=\"language-text\">context</code> variable of type <code class=\"language-text\">Partial&lt;OperationContext&gt;</code>.</p>\n<p><a href=\"https://formidable.com/open-source/urql/docs/getting-started#writing-mutations\">More information on how to use this hook can be found in the Getting Started section.</a></p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"usesubscription-hook\"\n                href=\"#usesubscription-hook\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              useSubscription (hook)\n            </h3>\n          \n<p>Accepts an options argument as its first input, and a second optional argument that is\nthe subscription handler function.</p>\n<p>The options argument shape is:</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">interface</span> <span class=\"token class-name\">UseSubscriptionArgs</span> <span class=\"token punctuation\">{</span>\n  query<span class=\"token punctuation\">:</span> string<span class=\"token punctuation\">;</span>\n  variables<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> any<span class=\"token punctuation\">;</span>\n  context<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> Partial<span class=\"token operator\">&lt;</span>OperationContext<span class=\"token operator\">></span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>And the handler has the signature:</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type SubscriptionHandler<span class=\"token operator\">&lt;</span><span class=\"token constant\">T</span><span class=\"token punctuation\">,</span> <span class=\"token constant\">R</span><span class=\"token operator\">></span> <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span><span class=\"token parameter\">prev<span class=\"token punctuation\">:</span> <span class=\"token constant\">R</span> <span class=\"token operator\">|</span> <span class=\"token keyword\">undefined</span><span class=\"token punctuation\">,</span> data<span class=\"token punctuation\">:</span> <span class=\"token constant\">T</span></span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token constant\">R</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>Meaning that the subscription handler receives the previous data or undefined\nand the current, incoming subscription event data.</p>\n<p>The hook returns a tuple of only its state:</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">interface</span> <span class=\"token class-name\">UseSubscriptionState</span><span class=\"token operator\">&lt;</span><span class=\"token constant\">T</span><span class=\"token operator\">></span> <span class=\"token punctuation\">{</span>\n  data<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> <span class=\"token constant\">T</span><span class=\"token punctuation\">;</span>\n  error<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> CombinedError<span class=\"token punctuation\">;</span>\n  extensions<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> Record<span class=\"token operator\">&lt;</span>string<span class=\"token punctuation\">,</span> any<span class=\"token operator\">></span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p><a href=\"https://formidable.com/open-source/urql/docs/basics#subscriptions\">More information on how to use this hook can be found in the Basics section.</a></p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"query-component\"\n                href=\"#query-component\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Query (component)\n            </h3>\n          \n<p><a href=\"https://formidable.com/open-source/urql/docs/getting-started#writing-queries\">More information on how to use this component can be found in the Getting Started section.</a></p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"props\"\n                href=\"#props\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Props\n            </h4>\n          \n<table>\n<thead>\n<tr>\n<th>Prop</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>query</td>\n<td><code class=\"language-text\">string</code></td>\n<td>The GraphQL request's query</td>\n</tr>\n<tr>\n<td>variables</td>\n<td><code class=\"language-text\">object</code></td>\n<td>The GraphQL request's variables</td>\n</tr>\n<tr>\n<td>context</td>\n<td><code class=\"language-text\">?object</code></td>\n<td>The GraphQL request's context</td>\n</tr>\n<tr>\n<td>requestPolicy</td>\n<td><code class=\"language-text\">?RequestPolicy</code></td>\n<td>An optional request policy that should be used</td>\n</tr>\n<tr>\n<td>pause</td>\n<td><code class=\"language-text\">?boolean</code></td>\n<td>A boolean flag instructing <code class=\"language-text\">Query</code> to pause execution of the subsequent query operation</td>\n</tr>\n<tr>\n<td>pollInterval</td>\n<td><code class=\"language-text\">?number</code></td>\n<td>Every <code class=\"language-text\">pollInterval</code> milliseconds the query will be refetched</td>\n</tr>\n<tr>\n<td>children</td>\n<td><code class=\"language-text\">RenderProps =&gt; ReactNode</code></td>\n<td>A function that follows the typical render props pattern. The shape of the render props is as follows</td>\n</tr>\n</tbody>\n</table>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"render-props\"\n                href=\"#render-props\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Render Props\n            </h4>\n          \n<table>\n<thead>\n<tr>\n<th>Prop</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>fetching</td>\n<td><code class=\"language-text\">boolean</code></td>\n<td>Whether the <code class=\"language-text\">Query</code> is currently waiting for a GraphQL result</td>\n</tr>\n<tr>\n<td>data</td>\n<td><code class=\"language-text\">?any</code></td>\n<td>The GraphQL request's result</td>\n</tr>\n<tr>\n<td>error</td>\n<td><code class=\"language-text\">?CombinedError</code></td>\n<td>The <code class=\"language-text\">CombinedError</code> containing any errors that might've occured</td>\n</tr>\n<tr>\n<td>extensions</td>\n<td><code class=\"language-text\">?Record&lt;string, any&gt;</code></td>\n<td>Optional extensions that the GraphQL server may have returned.</td>\n</tr>\n<tr>\n<td>executeQuery</td>\n<td><code class=\"language-text\">Partial&lt;OperationContext&gt; =&gt; void</code></td>\n<td>A function that can force the operation to be sent again with the given context (Useful for refetching)</td>\n</tr>\n</tbody>\n</table>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"mutation-component\"\n                href=\"#mutation-component\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Mutation (component)\n            </h3>\n          \n<p><a href=\"https://formidable.com/open-source/urql/docs/getting-started#writing-mutations\">More information on how to use this component can be found in the Getting Started section.</a></p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"props-1\"\n                href=\"#props-1\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Props\n            </h4>\n          \n<table>\n<thead>\n<tr>\n<th>Prop</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>query</td>\n<td><code class=\"language-text\">string</code></td>\n<td>The GraphQL request's query</td>\n</tr>\n<tr>\n<td>children</td>\n<td><code class=\"language-text\">RenderProps =&gt; ReactNode</code></td>\n<td>A function that follows the typical render props pattern. The shape of the render props is as follows</td>\n</tr>\n</tbody>\n</table>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"render-props-1\"\n                href=\"#render-props-1\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Render Props\n            </h4>\n          \n<table>\n<thead>\n<tr>\n<th>Prop</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>fetching</td>\n<td><code class=\"language-text\">boolean</code></td>\n<td>Whether the <code class=\"language-text\">Mutation</code> is currently waiting for a GraphQL result</td>\n</tr>\n<tr>\n<td>data</td>\n<td><code class=\"language-text\">?any</code></td>\n<td>The GraphQL request's result</td>\n</tr>\n<tr>\n<td>error</td>\n<td><code class=\"language-text\">?CombinedError</code></td>\n<td>The <code class=\"language-text\">CombinedError</code> containing any errors that might've occured</td>\n</tr>\n<tr>\n<td>extensions</td>\n<td><code class=\"language-text\">?Record&lt;string, any&gt;</code></td>\n<td>Optional extensions that the GraphQL server may have returned.</td>\n</tr>\n<tr>\n<td>executeMutation</td>\n<td><code class=\"language-text\">(variables: object, context?: Partial&lt;OperationContext&gt;) =&gt; void</code></td>\n<td>A function that accepts variables and starts the mutation</td>\n</tr>\n</tbody>\n</table>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"subscription-component\"\n                href=\"#subscription-component\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Subscription (component)\n            </h3>\n          \n<p><a href=\"https://formidable.com/open-source/urql/docs/basics#subscriptions\">More information on how to use this component can be found in the Basics section.</a></p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"props-2\"\n                href=\"#props-2\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Props\n            </h4>\n          \n<table>\n<thead>\n<tr>\n<th>Prop</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>query</td>\n<td><code class=\"language-text\">string</code></td>\n<td>The GraphQL subscription's query</td>\n</tr>\n<tr>\n<td>variables</td>\n<td><code class=\"language-text\">object</code></td>\n<td>The GraphQL subscriptions' variables</td>\n</tr>\n<tr>\n<td>context</td>\n<td><code class=\"language-text\">?Partial&lt;OperationContext&gt;</code></td>\n<td>The GraphQL subscriptions' context</td>\n</tr>\n<tr>\n<td>handler</td>\n<td><code class=\"language-text\">undefined \\| (prev: R \\| undefined, data: T) =&gt; R</code></td>\n<td>The handler that should combine/update the subscription's data with incoming data</td>\n</tr>\n<tr>\n<td>children</td>\n<td><code class=\"language-text\">RenderProps =&gt; ReactNode</code></td>\n<td>A function that follows the typical render props pattern. The shape of the render props is as follows</td>\n</tr>\n</tbody>\n</table>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"render-props-2\"\n                href=\"#render-props-2\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Render Props\n            </h4>\n          \n<table>\n<thead>\n<tr>\n<th>Prop</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>fetching</td>\n<td><code class=\"language-text\">boolean</code></td>\n<td>Whether the <code class=\"language-text\">Subscription</code> is currently ongoing</td>\n</tr>\n<tr>\n<td>data</td>\n<td><code class=\"language-text\">?any</code></td>\n<td>The GraphQL subscription's data</td>\n</tr>\n<tr>\n<td>error</td>\n<td><code class=\"language-text\">?CombinedError</code></td>\n<td>The <code class=\"language-text\">CombinedError</code> containing any errors that might've occured</td>\n</tr>\n<tr>\n<td>extensions</td>\n<td><code class=\"language-text\">?Record&lt;string, any&gt;</code></td>\n<td>Optional extensions that the GraphQL server may have returned.</td>\n</tr>\n</tbody>\n</table>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"context-components\"\n                href=\"#context-components\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Context components\n            </h3>\n          \n<p><code class=\"language-text\">urql</code> comes with the two context components <code class=\"language-text\">Consumer</code> and <code class=\"language-text\">Provider</code> as returned\nby React's <code class=\"language-text\">createContext</code> utility. It also exports the <code class=\"language-text\">Context</code> itself which can\nbe used in combination with the <code class=\"language-text\">useContext</code> hook.</p>\n\n            <h2>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"the-client-and-related-types\"\n                href=\"#the-client-and-related-types\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              The Client and related types\n            </h2>\n          \n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"client-class\"\n                href=\"#client-class\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Client (class)\n            </h3>\n          \n<p>The client manages all operations and ongoing requests to the exchange pipeline.\nIt accepts a bunch of inputs when it's created</p>\n<table>\n<thead>\n<tr>\n<th>Input</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>url</td>\n<td><code class=\"language-text\">string</code></td>\n<td>The GraphQL API URL as used by <code class=\"language-text\">fetchExchange</code></td>\n</tr>\n<tr>\n<td>fetchOptions</td>\n<td><code class=\"language-text\">RequestInit \\| () =&gt; RequestInit</code></td>\n<td>Additional <code class=\"language-text\">fetchOptions</code> that <code class=\"language-text\">fetch</code> in <code class=\"language-text\">fetchExchange</code> should use to make a request</td>\n</tr>\n<tr>\n<td>fetch</td>\n<td><code class=\"language-text\">typeof fetch</code></td>\n<td>An alternative implementation of <code class=\"language-text\">fetch</code> that will be used by the <code class=\"language-text\">fetchExchange</code> instead of <code class=\"language-text\">window.fetch</code></td>\n</tr>\n<tr>\n<td>suspense</td>\n<td><code class=\"language-text\">?boolean</code></td>\n<td>Activates the experimental React suspense mode, which can be used during server-side rendering to prefetch data</td>\n</tr>\n<tr>\n<td>exchanges</td>\n<td><code class=\"language-text\">Exchange[]</code></td>\n<td>An array of <code class=\"language-text\">Exchange</code>s that the client should use instead of the list of <code class=\"language-text\">defaultExchanges</code></td>\n</tr>\n</tbody>\n</table>\n<p><code class=\"language-text\">urql</code> also exposes <code class=\"language-text\">createClient()</code> that is just a convenient alternative to calling <code class=\"language-text\">new Client()</code>.</p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"executequery-executesubscription-and-executemutation\"\n                href=\"#executequery-executesubscription-and-executemutation\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              .executeQuery(), .executeSubscription(), and .executeMutation()\n            </h4>\n          \n<p>These methods are used by <code class=\"language-text\">&lt;Query&gt;</code> &#x26; <code class=\"language-text\">useQuery()</code>, <code class=\"language-text\">&lt;Subscription&gt;</code> &#x26; <code class=\"language-text\">useSubscription()</code>,\nand <code class=\"language-text\">&lt;Mutation&gt;</code> &#x26; <code class=\"language-text\">useMutation()</code> respectively.</p>\n<p>They accept a <code class=\"language-text\">GraphQLRequest</code> object as their first argument and optionally\na partial <code class=\"language-text\">OperationContext</code> as their second.</p>\n<p>Internally they then create an <code class=\"language-text\">Operation</code> and call <code class=\"language-text\">.executeRequestOperation()</code> with\nthe <code class=\"language-text\">Operation</code>. This then returns a <code class=\"language-text\">Source&lt;OperationResult&gt;</code>, i.e. a stream of\n<code class=\"language-text\">OperationResult</code>s.</p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"executerequestoperation\"\n                href=\"#executerequestoperation\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              .executeRequestOperation()\n            </h4>\n          \n<p>This method accepts an <code class=\"language-text\">Operation</code> and handles the flow of said <code class=\"language-text\">Operation</code>. Every <code class=\"language-text\">Operation</code>\nthat is executed must pass through this method.</p>\n<p>It creates a filtered <code class=\"language-text\">Source&lt;OperationResult&gt;</code> that only contains the <code class=\"language-text\">OperationResult</code>s\nrelevant to this <code class=\"language-text\">Operation</code> by filtering by the operation <code class=\"language-text\">key</code> and track the subscriptions\nto this <code class=\"language-text\">Source</code>.</p>\n<p>This is important as a cache exchange can call <code class=\"language-text\">reexecuteOperation</code> to inform the\nclient about an invalidation. Whenever an operation needs to be updated with new\nnetwork data, it's important to know whether any component is still interested in\nthis operation.</p>\n<p>To track this, this method ensures that a mapping is updated that counts up\nfor each subscription to the <code class=\"language-text\">Source</code> and counts down for each unsubscription.</p>\n<p>The <code class=\"language-text\">Operation</code> that has been passed to this method will be dispatched\nwhen the first subscription is started. When the last subscription unsubscribes\nfrom the returned source, this method will ensure that a <code class=\"language-text\">teardown</code> operation\nis dispatched.</p>\n<blockquote>\n<p><em>Note:</em> This does not apply to mutations, which are one-off calls and\nhence aren't shared, cancelled, or tracked in the cache.</p>\n</blockquote>\n<p>The return value is the filtered <code class=\"language-text\">Source&lt;OperationResult&gt;</code>.</p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"reexecuteoperation\"\n                href=\"#reexecuteoperation\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              .reexecuteOperation()\n            </h4>\n          \n<p>This method accepts an <code class=\"language-text\">Operation</code> and will dispatch this <code class=\"language-text\">Operation</code> if there\nare any subscriptions from <code class=\"language-text\">executeRequestOperation</code>'s <code class=\"language-text\">Source&lt;OperationResult&gt;</code>\nto this particular <code class=\"language-text\">Operation</code>.</p>\n<p>This is called by <code class=\"language-text\">cacheExchange</code> when an <code class=\"language-text\">Operation</code>'s <code class=\"language-text\">OperationResult</code> is\ninvalidated in the cache.</p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"createrequestoperation\"\n                href=\"#createrequestoperation\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              .createRequestOperation()\n            </h4>\n          \n<p>This is called by the <code class=\"language-text\">executeQuery</code>, <code class=\"language-text\">executeSubscription</code> and <code class=\"language-text\">executeMutation</code>\nmethods to create <code class=\"language-text\">Operation</code>s. It accepts:</p>\n<ul>\n<li><code class=\"language-text\">OperationType</code></li>\n<li><code class=\"language-text\">GraphQLRequest</code></li>\n<li>and; the optional partial <code class=\"language-text\">OperationContext</code> (<code class=\"language-text\">Partial&lt;OperationContext&gt;</code>)</li>\n</ul>\n<p>It returns an <code class=\"language-text\">Operation</code>.</p>\n\n            <h4>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"dispatchoperation\"\n                href=\"#dispatchoperation\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              .dispatchOperation()\n            </h4>\n          \n<p>This method dispatches an <code class=\"language-text\">Operation</code> to the exchange pipeline. This is only\nused directly by the Client and shouldn't normally be called externally, except\nwhen the tracking logic of active <code class=\"language-text\">Operation</code>s needs to be bypassed.</p>\n<p>These <code class=\"language-text\">Operation</code>s are streamed from the <code class=\"language-text\">operations$: Source&lt;Operation&gt;</code> stream.\nThe results of all exchanges are similarly output to <code class=\"language-text\">results$: Source&lt;OperationResult&gt;</code>.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"operationtype-type\"\n                href=\"#operationtype-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              OperationType (type)\n            </h3>\n          \n<p>This determines what <em>kind of operation</em> the exchanges need to perform.\nThis can either be:</p>\n<ul>\n<li><code class=\"language-text\">&#39;subscription&#39;</code></li>\n<li><code class=\"language-text\">&#39;query&#39;</code></li>\n<li><code class=\"language-text\">&#39;mutation&#39;</code></li>\n<li>or; <code class=\"language-text\">&#39;teardown&#39;</code></li>\n</ul>\n<p>The <code class=\"language-text\">&#39;teardown&#39;</code> operation is special in that it instructs exchanges to cancel\nany ongoing operations with the same key as the <code class=\"language-text\">&#39;teardown&#39;</code> operation that is\nreceived.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"requestpolicy-type\"\n                href=\"#requestpolicy-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              RequestPolicy (type)\n            </h3>\n          \n<p>This determines the strategy that a cache exchange should use to fulfill an operation.\nWhen you implement a custom cache exchange it's recommended that these policies are\nhandled.</p>\n<ul>\n<li><code class=\"language-text\">&#39;cache-first&#39;</code> (default)</li>\n<li><code class=\"language-text\">&#39;cache-only&#39;</code></li>\n<li><code class=\"language-text\">&#39;network-only&#39;</code></li>\n<li><code class=\"language-text\">&#39;cache-and-network&#39;</code></li>\n</ul>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"graphqlrequest-type\"\n                href=\"#graphqlrequest-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              GraphQLRequest (type)\n            </h3>\n          \n<p>This often comes up as the <strong>input</strong> for every GraphQL request.\nIt consists of <code class=\"language-text\">query</code> and optional <code class=\"language-text\">variables</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type Operation <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  query<span class=\"token punctuation\">:</span> string <span class=\"token operator\">|</span> DocumentNode<span class=\"token punctuation\">,</span>\n  variables<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> object<span class=\"token punctuation\">,</span>\n  key<span class=\"token punctuation\">:</span> number<span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>As can be seen it also carries a <code class=\"language-text\">key</code> property. This property\nis a hash of both the <code class=\"language-text\">query</code> and the <code class=\"language-text\">variables</code>, to uniquely\nidentify the request.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"operationcontext-type\"\n                href=\"#operationcontext-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              OperationContext (type)\n            </h3>\n          \n<p>This type is used to give an operation additional metadata and information.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type OperationContext <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  fetchOptions<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> RequestInit<span class=\"token punctuation\">,</span>\n  requestPolicy<span class=\"token punctuation\">:</span> RequestPolicy<span class=\"token punctuation\">,</span>\n  url<span class=\"token punctuation\">:</span> string<span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">[</span>key<span class=\"token punctuation\">:</span> string<span class=\"token punctuation\">]</span><span class=\"token punctuation\">:</span> any<span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>It contains a lot of the above mentioned Client options and also <code class=\"language-text\">requestPolicy</code>.\nIt accepts additional, untyped parameters that can be used to send more\ninformation to custom exchanges.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"operation-type\"\n                href=\"#operation-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Operation (type)\n            </h3>\n          \n<p>The input for every exchange that informs GraphQL requests.\nit's essentially an extension of the <code class=\"language-text\">GraphQLRequest</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type Operation <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  query<span class=\"token punctuation\">:</span> DocumentNode<span class=\"token punctuation\">,</span>\n  variables<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> object<span class=\"token punctuation\">,</span>\n  key<span class=\"token punctuation\">:</span> number<span class=\"token punctuation\">,</span>\n  operationName<span class=\"token punctuation\">:</span> OperationType<span class=\"token punctuation\">,</span>\n  context<span class=\"token punctuation\">:</span> OperationContext<span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>The <code class=\"language-text\">key</code> value is a \"hash\" of <code class=\"language-text\">query</code> and <code class=\"language-text\">variables</code> or another string that\nunique identifies the combination of the two.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"operationresult-type\"\n                href=\"#operationresult-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              OperationResult (type)\n            </h3>\n          \n<p>The result of every GraphQL request, i.e. an <code class=\"language-text\">Operation</code>.\nIt's very similar to what comes back from a typical GraphQL API, but\nslightly enriched.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type OperationResult <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  operation<span class=\"token punctuation\">:</span> Operation<span class=\"token punctuation\">,</span> <span class=\"token comment\">// The operation that this result is a response for</span>\n  data<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> any<span class=\"token punctuation\">,</span>\n  error<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> CombinedError<span class=\"token punctuation\">,</span>\n  extensions<span class=\"token operator\">?</span><span class=\"token punctuation\">:</span> Record<span class=\"token operator\">&lt;</span>string<span class=\"token punctuation\">,</span> any<span class=\"token operator\">></span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"combinederror-class\"\n                href=\"#combinederror-class\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              CombinedError (class)\n            </h3>\n          \n<table>\n<thead>\n<tr>\n<th>Input</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>networkError</td>\n<td><code class=\"language-text\">?Error</code></td>\n<td>An unexpected error that might've occured when trying to send the GraphQL request</td>\n</tr>\n<tr>\n<td>graphQLErrors</td>\n<td><code class=\"language-text\">?Array&lt;string \\| GraphQLError&gt;</code></td>\n<td>GraphQL Errors (if any) that were returned by the GraphQL API</td>\n</tr>\n<tr>\n<td>response</td>\n<td><code class=\"language-text\">?any</code></td>\n<td>The raw response object (if any) from the <code class=\"language-text\">fetch</code> call</td>\n</tr>\n</tbody>\n</table>\n<p>These are both inputs and properties on the <code class=\"language-text\">CombinedError</code>. Additionally it exposes a default <code class=\"language-text\">message</code>\nthat combines all errors it has received.</p>\n<p>This is on every <code class=\"language-text\">OperationResult</code> that has one or more errors and groups the usual <code class=\"language-text\">errors</code> property\nthat a GraphQL result might have normally.</p>\n\n            <h2>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"exchanges-and-their-utilities\"\n                href=\"#exchanges-and-their-utilities\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Exchanges and their utilities\n            </h2>\n          \n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"exchangeinput-type\"\n                href=\"#exchangeinput-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              ExchangeInput (type)\n            </h3>\n          \n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type ExchangeInput <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  forward<span class=\"token punctuation\">:</span> ExchangeIO<span class=\"token punctuation\">,</span>\n  client<span class=\"token punctuation\">:</span> Client<span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"exchangeio-type\"\n                href=\"#exchangeio-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              ExchangeIO (type)\n            </h3>\n          \n<p>A function that receives a stream of operations and must return a stream\nof results.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type <span class=\"token function-variable function\">ExchangeIO</span> <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span><span class=\"token parameter\">Source<span class=\"token operator\">&lt;</span>Operation<span class=\"token operator\">></span></span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> Source<span class=\"token operator\">&lt;</span>OperationResult<span class=\"token operator\">></span><span class=\"token punctuation\">;</span></code></pre></div>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"exchange-type\"\n                href=\"#exchange-type\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              Exchange (type)\n            </h3>\n          \n<p>Similar to <code class=\"language-text\">redux-observable</code>'s epics, kind of related to Apollo's links,\nalso somehow similar to Express' middleware.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\">type <span class=\"token function-variable function\">Exchange</span> <span class=\"token operator\">=</span> <span class=\"token parameter\">ExchangeInput</span> <span class=\"token operator\">=></span> ExchangeIO<span class=\"token punctuation\">;</span></code></pre></div>\n<p>This works since every exchange receives <code class=\"language-text\">forward</code> with the <code class=\"language-text\">ExchangeInput</code>.\nExchanges can therefore be chained. They can alter and filter <code class=\"language-text\">Operation</code>s\nthat go into the next exchange, and they can alter, filter, or return\n<code class=\"language-text\">OperationResult</code>s that are returned.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"composeexchanges-function\"\n                href=\"#composeexchanges-function\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              composeExchanges (function)\n            </h3>\n          \n<p>This utility accepts multiple exchanges and composes them into a single one.\nIt chains them in the order that they're given, left to right.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">function</span> <span class=\"token function\">composeExchanges</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">Exchange<span class=\"token punctuation\">[</span><span class=\"token punctuation\">]</span></span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">:</span> Exchange<span class=\"token punctuation\">;</span></code></pre></div>\n<p>This can be used to combine some exchanges and is also used by <code class=\"language-text\">Client</code>\nto handle the <code class=\"language-text\">exchanges</code> input.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"cacheexchange-exchange\"\n                href=\"#cacheexchange-exchange\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              cacheExchange (Exchange)\n            </h3>\n          \n<p>The <code class=\"language-text\">cacheExchange</code> as <a href=\"https://formidable.com/open-source/urql/docs/basics#cacheexchange\">described in the Basics section</a>.\nIt's of type <code class=\"language-text\">Exchange</code>.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"subscriptionexchange-exchange-factory\"\n                href=\"#subscriptionexchange-exchange-factory\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              subscriptionExchange (Exchange factory)\n            </h3>\n          \n<p>The <code class=\"language-text\">subscriptionExchange</code> as <a href=\"https://formidable.com/open-source/urql/docs/basics#subscriptions\">described in the Basics section</a>.\nIt's of type <code class=\"language-text\">Options =&gt; Exchange</code>.</p>\n<p>It accepts a single input: <code class=\"language-text\">{ forwardSubscription }</code>. This is a function that\nreceives an enriched operation and must return an Observable-like object that\nstreams <code class=\"language-text\">GraphQLResult</code>s with <code class=\"language-text\">data</code> and <code class=\"language-text\">errors</code>.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"ssrexchange-exchange-factory\"\n                href=\"#ssrexchange-exchange-factory\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              ssrExchange (Exchange factory)\n            </h3>\n          \n<p>The <code class=\"language-text\">ssrExchange</code> as <a href=\"https://formidable.com/open-source/urql/docs/basics#server-side-rendering\">described in the Basics section</a>.\nIt's of type <code class=\"language-text\">Options =&gt; Exchange</code>.</p>\n<p>It accepts two inputs, <code class=\"language-text\">initialState</code> which is completely\noptional and populates the server-side rendered data with\na rehydrated cache, and <code class=\"language-text\">isClient</code> which can be set to\n<code class=\"language-text\">true</code> or <code class=\"language-text\">false</code> to tell the <code class=\"language-text\">ssrExchange</code> whether to\nwrite to (server-side) or read from (client-side) the cache.</p>\n<p>By default <code class=\"language-text\">isClient</code> defaults to <code class=\"language-text\">true</code> when the <code class=\"language-text\">Client.suspense</code>\nmode is disabled and to <code class=\"language-text\">false</code> when the <code class=\"language-text\">Client.suspense</code> mode\nis enabled.</p>\n<p>This can be used to extract data that has been queried on\nthe server-side, which is also described in the Basics section,\nand is also used on the client-side to restore server-side\nrendered data.</p>\n<p>When called, this function creates an <code class=\"language-text\">Exchange</code>, which also has\ntwo methods on it:</p>\n<ul>\n<li><code class=\"language-text\">.restoreData(data)</code> which can be used to inject data, typically\non the client-side.</li>\n<li><code class=\"language-text\">.extractData()</code> which is typically used on the server-side to\nextract the server-side rendered data.</li>\n</ul>\n<p>Basically, the <code class=\"language-text\">ssrExchange</code> is a small cache that collects data\nduring the server-side rendering pass, and allows you to populate\nthe cache on the client-side with the same data.</p>\n<p>During React rehydration this cache will be emptied and it will\nbecome inactive and won't change the results of queries after\nrehydration.</p>\n<p>It needs to be used <em>after</em> other caching Exchanges like the\n<code class=\"language-text\">cacheExchange</code>, but before any <em>asynchronous</em> Exchange like\nthe <code class=\"language-text\">fetchExchange</code>.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"debugexchange-exchange\"\n                href=\"#debugexchange-exchange\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              debugExchange (Exchange)\n            </h3>\n          \n<p>An exchange that writes incoming <code class=\"language-text\">Operation</code>s to <code class=\"language-text\">console.log</code> and\nwrites completed <code class=\"language-text\">OperationResult</code>s to <code class=\"language-text\">console.log</code>.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"dedupexchange-exchange\"\n                href=\"#dedupexchange-exchange\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              dedupExchange (Exchange)\n            </h3>\n          \n<p>An exchange that keeps track of ongoing <code class=\"language-text\">Operation</code>s that haven't returned had\na corresponding <code class=\"language-text\">OperationResult</code> yet. Any duplicate <code class=\"language-text\">Operation</code> that it\nreceives is filtered out if the same <code class=\"language-text\">Operation</code> has already been received\nand is still waiting for a result.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"fallbackexchangeio-exchangeio\"\n                href=\"#fallbackexchangeio-exchangeio\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              fallbackExchangeIO (ExchangeIO)\n            </h3>\n          \n<p>This is an <code class=\"language-text\">ExchangeIO</code> function that the <code class=\"language-text\">Client</code> adds on after all\nexchanges. This function is responsible from filtering <code class=\"language-text\">teardown</code> operations\nout of the output and also warns you of unhandled <code class=\"language-text\">operationName</code>s which\ncan occur when a subscription is used without adding a <code class=\"language-text\">subscriptionExchange</code>.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"fetchexchange-exchange\"\n                href=\"#fetchexchange-exchange\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              fetchExchange (Exchange)\n            </h3>\n          \n<p>The <code class=\"language-text\">fetchExchange</code> as <a href=\"https://formidable.com/open-source/urql/docs/basics#fetchexchange\">described in the Basics section</a>.\nIt's of type <code class=\"language-text\">Exchange</code>.</p>\n\n            <h3>\n              <a class=\"Anchor\"\n                aria-hidden=\"true\"\n                id=\"defaultexchanges-exchange\"\n                href=\"#defaultexchanges-exchange\"\n              >\n                <svg viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\"aria-hidden=\"true\">\n                  <path fill-rule=\"evenodd\"\n                    d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n                  />\n                </svg>\n              </a>\n              defaultExchanges (Exchange[])\n            </h3>\n          \n<p>An array of the default exchanges that the <code class=\"language-text\">Client</code> uses when it wasn't passed\nan <code class=\"language-text\">exchanges</code> option.</p>\n<div class=\"gatsby-highlight\" data-language=\"js\"><pre class=\"language-js\"><code class=\"language-js\"><span class=\"token keyword\">const</span> defaultExchanges <span class=\"token operator\">=</span> <span class=\"token punctuation\">[</span>dedupExchange<span class=\"token punctuation\">,</span> cacheExchange<span class=\"token punctuation\">,</span> fetchExchange<span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span></code></pre></div>\n","tocArray":[{"content":"API","level":1},{"content":"React components and hooks","level":2},{"content":"useQuery (hook)","level":3},{"content":"useMutation (hook)","level":3},{"content":"useSubscription (hook)","level":3},{"content":"Query (component)","level":3},{"content":"Mutation (component)","level":3},{"content":"Subscription (component)","level":3},{"content":"Context components","level":3},{"content":"The Client and related types","level":2},{"content":"Client (class)","level":3},{"content":"OperationType (type)","level":3},{"content":"RequestPolicy (type)","level":3},{"content":"GraphQLRequest (type)","level":3},{"content":"OperationContext (type)","level":3},{"content":"Operation (type)","level":3},{"content":"OperationResult (type)","level":3},{"content":"CombinedError (class)","level":3},{"content":"Exchanges and their utilities","level":2},{"content":"ExchangeInput (type)","level":3},{"content":"ExchangeIO (type)","level":3},{"content":"Exchange (type)","level":3},{"content":"composeExchanges (function)","level":3},{"content":"cacheExchange (Exchange)","level":3},{"content":"subscriptionExchange (Exchange factory)","level":3},{"content":"ssrExchange (Exchange factory)","level":3},{"content":"debugExchange (Exchange)","level":3},{"content":"dedupExchange (Exchange)","level":3},{"content":"fallbackExchangeIO (ExchangeIO)","level":3},{"content":"fetchExchange (Exchange)","level":3},{"content":"defaultExchanges (Exchange[])","level":3}]}}
