Sitecore Community GraphQL Cookbook

Get Simple Breadcrumb

GraphQL query to retrieve the breadcrumb and related fields for a specific page
Source:
    Delivery APICommunitySample Component

JSON Variables


Query


JSON Response

1{
2  "data": {
3    "item": {
4      "navigationTitle": {
5        "jsonValue": {
6          "value": "contact-us"
7        }
8      },
9      "navigationFilter": {
10        "jsonValue": []
11      },
12      "navigationClass": {
13        "jsonValue": null
14      },
15      "url": {
16        "path": "/about-us/contact-us"
17      },
18      "ancestors": [
19        {
20          "navigationTitle": {
21            "jsonValue": {
22              "value": "about us"
23            }
24          },
25          "navigationFilter": {
26            "jsonValue": [
27              {
28                "id": "e0a2a027-0932-4878-a7d6-0416d5263efb",
29                "url": "http://localhost/en/sitecore/system/Settings/Foundation/Experience-Accelerator/Navigation/Navigation-Filters/Breadcrumb-Navigation",
30                "name": "Breadcrumb Navigation",
31                "displayName": "Breadcrumb Navigation",
32                "fields": {
33                  "Key": {
34                    "value": "breadcrumb"
35                  }
36                }
37              }
38            ]
39          },
40          "navigationClass": {
41            "jsonValue": null
42          },
43          "url": {
44            "path": "/about-us"
45          }
46        },
47        {
48          "navigationTitle": {
49            "jsonValue": {
50              "value": "graphql-demo"
51            }
52          },
53          "navigationFilter": {
54            "jsonValue": []
55          },
56          "navigationClass": {
57            "jsonValue": null
58          },
59          "url": {
60            "path": "/"
61          }
62        }
63      ]
64    }
65  }
66}