Sitecore Community GraphQL Cookbook

Search - Paging the search result

Simple paged Search GraphQL Query that finds items based on the root path, template ID, and language. Page the result with the endCursor hash.
Source: Mihály Árvai
    Delivery APISearchCommunity

JSON Variables


Query


JSON Response

1{
2  "data": {
3    "item": {
4      "total": 2,
5      "pageInfo": {
6        "hasNext": true,
7        "endCursor": "eyJzZWFyY2hBZnRlciI6WzE3MjQ0MDI1OTUwMDAsIkU5M0IxREU2ODc0NzQ1N0VCRTFGRkFEMzVGMjMyNzc4IiwiRTkzQjFERTY4NzQ3NDU3RUJFMUZGQUQzNUYyMzI3NzgiXSwiY291bnQiOjF9"
8      },
9      "results": [
10        {
11          "id": "E93B1DE68747457EBE1FFAD35F232778",
12          "name": "Second Article",
13          "title": {
14            "jsonValue": {
15              "value": "Second Article"
16            }
17          },
18          "Author": {
19            "jsonValue": [
20              {
21                "id": "aea9379d-ac2e-4b9c-aee2-efb6a37a3a46",
22                "url": "/en/Authors/John-Doe",
23                "name": "John Doe",
24                "displayName": "John Doe",
25                "fields": {
26                  "First Name": {
27                    "value": "John"
28                  },
29                  "Last Name": {
30                    "value": "Doe"
31                  }
32                }
33              }
34            ]
35          },
36          "created": {
37            "jsonValue": {
38              "value": "2024-08-23T08:43:15Z"
39            }
40          },
41          "tags": {
42            "jsonValue": []
43          },
44          "url": {
45            "path": "/Articles/Second-Article"
46          }
47        }
48      ]
49    }
50  }
51}