Skip to content

Commit c6cc5fd

Browse files
authored
maint: spelling (#167)
Signed-off-by: Josh Soref <[email protected]> BREAKING CHANGE: change spelling of `paginateGraphql` export to `paginateGraphQL`
1 parent cbdebb9 commit c6cc5fd

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ Only one version number is bumped at a time, the highest version change trumps t
5656
Besides publishing a new version to npm, semantic-release also creates a git tag and release
5757
on GitHub, generates changelogs from the commit messages and puts them into the release notes.
5858

59-
Before the publish it runs the `npm run build` script which creates a `pkg/` folder with distributions for browsers, node and Typescript definitions. The contents of the `pkg/` folder are published to the npm registry.
59+
Before the publish it runs the `npm run build` script which creates a `pkg/` folder with distributions for browsers, node and TypeScript definitions. The contents of the `pkg/` folder are published to the npm registry.
6060

6161
If the pull request looks good but does not follow the commit conventions, use the <kbd>Squash & merge</kbd> button.

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Load `@octokit/plugin-paginate-graphql` and [`@octokit/core`](https://github.com
1818
```html
1919
<script type="module">
2020
import { Octokit } from "https://esm.sh/@octokit/core";
21-
import { paginateGraphql } from "https://esm.sh/@octokit/plugin-paginate-graphql";
21+
import { paginateGraphQL } from "https://esm.sh/@octokit/plugin-paginate-graphql";
2222
</script>
2323
```
2424

@@ -31,15 +31,15 @@ Install with `npm install @octokit/core @octokit/plugin-paginate-graphql`. Optio
3131

3232
```js
3333
const { Octokit } = require("@octokit/core");
34-
const { paginateGraphql } = require("@octokit/plugin-paginate-graphql");
34+
const { paginateGraphQL } = require("@octokit/plugin-paginate-graphql");
3535
```
3636

3737
</td></tr>
3838
</tbody>
3939
</table>
4040

4141
```js
42-
const MyOctokit = Octokit.plugin(paginateGraphql);
42+
const MyOctokit = Octokit.plugin(paginateGraphQL);
4343
const octokit = new MyOctokit({ auth: "secret123" });
4444

4545
const { repository } = await octokit.graphql.paginate(
@@ -61,18 +61,18 @@ const { repository } = await octokit.graphql.paginate(
6161
console.log(`Found ${repository.issues.nodes.length} issues!`);
6262
```
6363

64-
There are two convetions this plugin relies on:
64+
There are two conventions this plugin relies on:
6565

6666
1. The name of the cursor variable must be `$cursor`
6767
2. You must include a valid `pageInfo` object in the paginated resource (see [Pagination Direction](#pagination-direction) for more info on what is considered valid)
6868

6969
## `octokit.graphql.paginate()`
7070

71-
The `paginateGraphql` plugin adds a new `octokit.graphql.paginate()` method which accepts a query with a single `$cursor` variable that is used to paginate.
71+
The `paginateGraphQL` plugin adds a new `octokit.graphql.paginate()` method which accepts a query with a single `$cursor` variable that is used to paginate.
7272

7373
The query gets passed over to the `octokit.graphql()`-function. The response is then scanned for the required `pageInfo`-object. If `hasNextPage` is `true`, it will automatically use the `endCursor` to execute the next query until `hasNextPage` is `false`.
7474

75-
While iterating, it ongoingly merges all `nodes` and/or `edges` of all responses and returns a combined response in the end.
75+
While iterating, it continually merges all `nodes` and/or `edges` of all responses and returns a combined response in the end.
7676

7777
> **Warning**
7878
> Please note that this plugin only supports pagination of a single resource - so you can **not** execute queries with parallel or nested pagination. You can find more details in [the chapter below](#unsupported-nested-pagination).
@@ -159,7 +159,7 @@ await octokit.graphql.paginate(
159159

160160
### Pagination Direction
161161

162-
You can control the pagination direction by the properties deinfed in the `pageInfo` resource.
162+
You can control the pagination direction by the properties defined in the `pageInfo` resource.
163163

164164
For a forward pagination, use:
165165

@@ -183,7 +183,7 @@ If you provide all 4 properties in a `pageInfo`, the plugin will default to forw
183183

184184
### Unsupported: Nested pagination
185185

186-
Nested pagination with GraphlQL is complicated, so the following **is not supported**:
186+
Nested pagination with GraphQL is complicated, so the following **is not supported**:
187187

188188
```js
189189
await octokit.graphql.paginate((cursor) => {
@@ -218,7 +218,7 @@ There is a great video from GitHub Universe 2019 [Advanced patterns for GitHub's
218218

219219
### TypeScript Support
220220

221-
You can type the response of the `paginateGraphql()` and `iterator()` functions like this:
221+
You can type the response of the `paginateGraphQL()` and `iterator()` functions like this:
222222

223223
```ts
224224
await octokit.graphql.paginate<RepositoryIssueResponseType>((cursor) => {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createIterator } from "./iterator";
33
import { createPaginate } from "./paginate";
44
export type { PageInfoForward, PageInfoBackward } from "./page-info";
55

6-
export function paginateGraphql(octokit: Octokit) {
6+
export function paginateGraphQL(octokit: Octokit) {
77
octokit.graphql;
88
return {
99
graphql: Object.assign(octokit.graphql, {

test/paginate-graphql.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Octokit } from "@octokit/core";
2-
import { paginateGraphql } from "../src";
2+
import { paginateGraphQL } from "../src";
33

4-
const PatchedOctokit = Octokit.plugin(paginateGraphql);
4+
const PatchedOctokit = Octokit.plugin(paginateGraphQL);
55

66
const token = process.env.E2E_GITHUB_TOKEN;
77
if (!token) {

test/paginate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe("pagination", () => {
106106
`
107107
query paginate($cursor: String, $organization: String!) {
108108
repository(owner: $organization, name: "rest.js") {
109-
issues(first: 10, after: $curosr) {
109+
issues(first: 10, after: $cursor) {
110110
nodes {
111111
title
112112
}

test/testHelpers/mock-octokit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Octokit } from "@octokit/core";
2-
import { paginateGraphql } from "../../src/index";
2+
import { paginateGraphQL } from "../../src/index";
33
import fetchMock from "fetch-mock";
44

5-
const PatchedOctokit = Octokit.plugin(paginateGraphql);
5+
const PatchedOctokit = Octokit.plugin(paginateGraphQL);
66

77
const MockOctokit = ({ responses = [{}] }: { responses?: any[] } = {}) => {
88
let calledQueries: string[] = [];

test/typescript-validate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// ************************************************************
44

55
import { Octokit } from "@octokit/core";
6-
import { paginateGraphql, PageInfoBackward, PageInfoForward } from "../src";
6+
import { paginateGraphQL, PageInfoBackward, PageInfoForward } from "../src";
77
import { TestResponseType } from "./testHelpers/mock-response";
88

9-
const MyOctokit = Octokit.plugin(paginateGraphql);
9+
const MyOctokit = Octokit.plugin(paginateGraphQL);
1010
const octokit = new MyOctokit();
1111

1212
const query = `
@@ -37,7 +37,7 @@ export async function typedIterator() {
3737
}
3838
}
3939

40-
export function pageInfoBackwaredExported(): PageInfoBackward {
40+
export function pageInfoBackwardExported(): PageInfoBackward {
4141
return {
4242
hasPreviousPage: true,
4343
startCursor: "startCursor",

0 commit comments

Comments
 (0)