8000 README update, pagination · jxmot/github-graphql-snippets@8ccfbb2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ccfbb2

Browse files
committed
README update, pagination
1 parent bf0b62a commit 8ccfbb2

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

pagination/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ First, open a GraphQL *explorer*. This example should also work with GitHub's [G
2222

2323
The query:
2424

25-
```
25+
<pre>
2626
query($fst:Int, $lst:Int, $aft:String, $bef:String) {
2727
viewer {
2828
login
@@ -32,14 +32,14 @@ query($fst:Int, $lst:Int, $aft:String, $bef:String) {
3232
last: $lst,
3333
after: $aft,
3434
before: $bef) {
35-
totalCount
35+
totalCount<strong>
3636
# This will be necessary for navigating between the pages.
3737
pageInfo {
3838
hasNextPage
3939
endCursor
4040
hasPreviousPage
4141
startCursor
42-
}
42+
}</strong>
4343
edges {
4444
starredAt
4545
node {
@@ -54,7 +54,7 @@ query($fst:Int, $lst:Int, $aft:String, $bef:String) {
5454
}
5555
}
5656
}
57-
```
57+
</pre>
5858

5959
Variables needed by the query, paste this into the *query variables* pane :
6060

@@ -69,7 +69,7 @@ Variables needed by the query, paste this into the *query variables* pane :
6969

7070
<details>
7171
<summary>
72-
Here is the reply to the query above:
72+
<strong>Here is the reply to the query above:</strong>(<i>click to expand</i>)
7373
</summary>
7474
<pre>
7575
{
@@ -78,13 +78,13 @@ Here is the reply to the query above:
7878
"login": "jxmot",
7979
"name": "J.Motyl",
8080
"starredRepositories": {
81-
"totalCount": 279,
81+
"totalCount": 279,<strong>
8282
"pageInfo": {
8383
"hasNextPage": true,
8484
"endCursor": "Y3Vyc29yOnYyOpK5MjAyMC0xMi0xNFQxMTo0Mjo0My0wNjowMM4O_J02",
8585
"hasPreviousPage": false,
8686
"startCursor": "Y3Vyc29yOnYyOpK5MjAyMC0xMi0xNlQxMzoyODoyMC0wNjowMM4PAfB-"
87-
},
87+
},</strong>
8888
"edges": [
8989
{
9090
"starredAt": "2020-12-16T19:28:20Z",
@@ -127,7 +127,6 @@ Here is the reply to the query above:
127127
</pre>
128128
</details>
129129

130-
131130
To see how pagination works use these steps:
132131

133132
1) Run the query with the data as shown below
@@ -139,9 +138,9 @@ To see how pagination works use these steps:
139138
becomes `false`.
140139

141140
5) To go to the previous page copy the string from the result at `pageInfo.startCursor` into the `bef` data item
142-
6) Set `aft` to `null`
143-
7) Set `fst` to `null`
144-
8) Set `lst` to 3
141+
6) Set **`aft`** to `null`
142+
7) Set **`fst`** to `null`
143+
8) Set **`lst`** to 3
145144
9) Run the query again
146145
10) The previous "page" will be returned
147146

0 commit comments

Comments
 (0)
0