Skip to content

Commit 7555a19

Browse files
committed
Rename the Operation type GraphQLOperation.
1 parent 1ace347 commit 7555a19

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
- Updated dependencies.
1414
- Updated package scripts and config for the new [`husky`](https://npm.im/husky) version.
15+
- Renamed the `Operation` type `GraphQLOperation`.
1516

1617
## 2.0.1
1718

readme.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ Consider polyfilling:
140140
- [type FetchOptions](#type-fetchoptions)
141141
- [type FetchOptionsOverride](#type-fetchoptionsoverride)
142142
- [Examples](#examples-8)
143+
- [type GraphQLOperation](#type-graphqloperation)
143144
- [type HttpError](#type-httperror)
144-
- [type Operation](#type-operation)
145145
- [type QueryRender](#type-queryrender)
146146
- [Examples](#examples-9)
147147
- [type RequestCache](#type-requestcache)
@@ -172,7 +172,7 @@ Queries a GraphQL server.
172172
| Parameter | Type | Description |
173173
| :----------------------------- | :-------------------------------------------------- | :--------------------------------------------------------------------------------------- |
174174
| `options` | [Object](https://mdn.io/object) | Options. |
175-
| `options.operation` | [Operation](#type-operation) | GraphQL operation object. |
175+
| `options.operation` | [GraphQLOperation](#type-graphqloperation) | GraphQL operation. |
176176
| `options.fetchOptionsOverride` | [FetchOptionsOverride](#type-fetchoptionsoverride)? | Overrides default GraphQL request [fetch options](#type-fetchoptions). |
177177
| `options.resetOnLoad` | [boolean](https://mdn.io/boolean)? = `false` | Should the [GraphQL cache](#graphql-instance-property-cache) reset when the query loads. |
178178
@@ -446,10 +446,10 @@ Overrides default GraphQL request [fetch options](#type-fetchoptions). Modify th
446446
447447
**Type:** [function](https://mdn.io/function)
448448
449-
| Parameter | Type | Description |
450-
| :------------- | :--------------------------------- | :------------------------------------- |
451-
| `fetchOptions` | [FetchOptions](#type-fetchoptions) | Default GraphQL request fetch options. |
452-
| `operation` | [Operation](#type-operation)? | A GraphQL operation object. |
449+
| Parameter | Type | Description |
450+
| :------------- | :------------------------------------------ | :------------------------------------- |
451+
| `fetchOptions` | [FetchOptions](#type-fetchoptions) | Default GraphQL request fetch options. |
452+
| `operation` | [GraphQLOperation](#type-graphqloperation)? | GraphQL operation. |
453453
454454
#### Examples
455455
@@ -462,6 +462,17 @@ _Setting [fetch options](#type-fetchoptions) for an example API._
462462
> }
463463
> ```
464464
465+
### type GraphQLOperation
466+
467+
A GraphQL operation. Additional properties may be used; all are sent to the GraphQL server.
468+
469+
**Type:** [Object](https://mdn.io/object)
470+
471+
| Property | Type | Description |
472+
| :---------- | :------------------------------ | :---------------------------- |
473+
| `query` | [string](https://mdn.io/string) | GraphQL queries or mutations. |
474+
| `variables` | [Object](https://mdn.io/object) | Variables used by the query. |
475+
465476
### type HttpError
466477
467478
Fetch HTTP error.
@@ -473,17 +484,6 @@ Fetch HTTP error.
473484
| `status` | [number](https://mdn.io/number) | HTTP status code. |
474485
| `statusText` | [string](https://mdn.io/string) | HTTP status text. |
475486
476-
### type Operation
477-
478-
A GraphQL operation object. Additional properties may be used; all are sent to the GraphQL server.
479-
480-
**Type:** [Object](https://mdn.io/object)
481-
482-
| Property | Type | Description |
483-
| :---------- | :------------------------------ | :---------------------------- |
484-
| `query` | [string](https://mdn.io/string) | GraphQL queries or mutations. |
485-
| `variables` | [Object](https://mdn.io/object) | Variables used by the query. |
486-
487487
### type QueryRender
488488
489489
Renders the status of a query or mutation.

src/graphql.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class GraphQL {
2121
* object. See the [GraphQL multipart request spec](https://github.com/jaydenseric/graphql-multipart-request-spec).
2222
* @kind function
2323
* @name GraphQL.requestBody
24-
* @param {Operation} operation GraphQL operation.
24+
* @param {GraphQLOperation} operation GraphQL operation.
2525
* @returns {string|FormData} A JSON string, or for uploads a multipart form.
2626
* @ignore
2727
*/
@@ -48,7 +48,7 @@ export class GraphQL {
4848
* Gets default [fetch options]{@link FetchOptions} for a GraphQL operation.
4949
* @kind function
5050
* @name GraphQL.fetchOptions
51-
* @param {Operation} operation GraphQL operation.
51+
* @param {GraphQLOperation} operation GraphQL operation.
5252
* @returns {FetchOptions} Fetch options.
5353
* @ignore
5454
*/
@@ -236,7 +236,7 @@ export class GraphQL {
236236
* @kind function
237237
* @name GraphQL#query
238238
* @param {Object} options Options.
239-
* @param {Operation} options.operation GraphQL operation object.
239+
* @param {GraphQLOperation} options.operation GraphQL operation.
240240
* @param {FetchOptionsOverride} [options.fetchOptionsOverride] Overrides default GraphQL request [fetch options]{@link FetchOptions}.
241241
* @param {boolean} [options.resetOnLoad=false] Should the [GraphQL cache]{@link GraphQL#cache} reset when the query loads.
242242
* @returns {ActiveQuery} Loading query details.
@@ -273,10 +273,10 @@ export class GraphQL {
273273
*/
274274

275275
/**
276-
* A GraphQL operation object. Additional properties may be used; all are sent
276+
* A GraphQL operation. Additional properties may be used; all are sent
277277
* to the GraphQL server.
278278
* @kind typedef
279-
* @name Operation
279+
* @name GraphQLOperation
280280
* @type {Object}
281281
* @prop {string} query GraphQL queries or mutations.
282282
* @prop {Object} variables Variables used by the query.
@@ -301,7 +301,7 @@ export class GraphQL {
301301
* @name FetchOptionsOverride
302302
* @type {function}
303303
* @param {FetchOptions} fetchOptions Default GraphQL request fetch options.
304-
* @param {Operation} [operation] A GraphQL operation object.
304+
* @param {GraphQLOperation} [operation] GraphQL operation.
305305
* @example <caption>Setting [fetch options]{@link FetchOptions} for an example API.</caption>
306306
* ```js
307307
* options => {

0 commit comments

Comments
 (0)