You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[src/components.mjs:23-23](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/components.mjs#L23-L23'Source code on GitHub')
90
+
90
91
A React component that puts a [GraphQL](#graphql) instance in context for nested [Consumer](#consumer) components to use.
<Provider value={graphql}>Use Consumer or Query components…</Provider>
108
107
)
109
108
```
110
109
111
110
Returns **ReactElement** React virtual DOM element.
112
111
113
112
### Consumer
114
113
114
+
[src/components.mjs:39-39](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/components.mjs#L39-L39'Source code on GitHub')
115
+
115
116
A React component that gets the [GraphQL](#graphql) instance from context.
116
117
117
118
**Parameters**
@@ -136,6 +137,8 @@ Returns **ReactElement** React virtual DOM element.
136
137
137
138
### Query
138
139
140
+
[src/components.mjs:241-245](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/components.mjs#L241-L245'Source code on GitHub')
141
+
139
142
A React component to manage a GraphQL query or mutation.
Returns **ReactElement** React virtual DOM element.
234
-
235
218
### QueryRender
236
219
220
+
[src/components.mjs:247-254](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/components.mjs#L247-L254'Source code on GitHub')
*`options.cache`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Cache to import; useful once a SSR API is available. (optional, default `{}`)
273
-
*`options.requestOptions`**[RequestOptionsOverride](#requestoptionsoverride)?** A function that accepts and modifies generated options for every request.
250
+
### ConsumerRender
274
251
275
-
**Examples**
252
+
[src/components.mjs:247-254](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/components.mjs#L247-L254'Source code on GitHub')
Returns **ReactElement** React virtual DOM element.
307
271
308
-
### RequestCache
272
+
### ActiveQuery
309
273
310
-
JSON serializable result of a request (including all errors and data) for caching purposes.
274
+
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
338
300
339
-
Fetch HTTP error.
301
+
A GraphQL operation object. Additional properties may be used; all are sent to the GraphQL server.
*`status`**[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**HTTP status code.
346
-
*`statusText`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**HTTP status text.
307
+
*`query`**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**GraphQL queries or mutations.
308
+
*`variables`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**Variables used by the query.
347
309
348
-
### ActiveQuery
310
+
### RequestOptions
311
+
312
+
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
313
+
314
+
Options for a GraphQL fetch request. See [polyfillable fetch options](https://github.github.io/fetch/#options).
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
328
+
360
329
A way to override request options generated for a fetch. Modify the provided options object directly; no return.
Options for a GraphQL fetch request. See [polyfillable fetch options](https://github.github.io/fetch/#options).
348
+
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
*`options.cache`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Cache to import; useful once a SSR API is available. (optional, default `{}`)
356
+
*`options.requestOptions`**[RequestOptionsOverride](#requestoptionsoverride)?** A function that accepts and modifies generated options for every request.
389
357
390
-
### Operation
358
+
**Examples**
391
359
392
-
A GraphQL operation object. Additional properties may be used; all are sent to the GraphQL server.
360
+
```javascript
361
+
import { GraphQL } from'graphql-react'
362
+
363
+
constgraphql=newGraphQL({
364
+
requestOptions:options=> {
365
+
options.url='https://api.example.com/graphql'
366
+
options.credentials='include'
367
+
}
368
+
})
369
+
```
370
+
371
+
#### cache
372
+
373
+
[src/graphql.mjs:25-25](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L25-L25'Source code on GitHub')
374
+
375
+
GraphQL request cache.
376
+
377
+
#### reset
378
+
379
+
[src/graphql.mjs:75-79](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L75-L79'Source code on GitHub')
380
+
381
+
Resets the cache. Useful when a user logs out.
382
+
383
+
**Examples**
384
+
385
+
```javascript
386
+
graphql.reset()
387
+
```
388
+
389
+
#### query
390
+
391
+
[src/graphql.mjs:194-206](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L194-L206'Source code on GitHub')
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
404
+
405
+
A promise for an in-flight query that resolves the request cache.
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
[src/graphql.mjs:19-207](https://github.com/jaydenseric/graphql-react/blob/f908346ed98ffff6e01b29c42236745bed87a7a8/src/graphql.mjs#L19-L207'Source code on GitHub')
424
+
425
+
JSON serializable result of a request (including all errors and data) for caching purposes.
0 commit comments