Sitecore Community GraphQL Cookbook

Fields - General Link

GraphQL query to demonstrate different ways to retrieve General Link field from Experience Edge
Source:
    CommunityDelivery APIFields

JSON Variables


Query


JSON Response

1{
2  "data": {
3    "item": {
4      "linkWithJsonValue": {
5        "jsonValue": {
6          "value": {
7            "text": "About us",
8            "anchor": "anchor",
9            "linktype": "internal",
10            "class": "",
11            "title": "alt text",
12            "target": "_blank",
13            "querystring": "",
14            "id": "{5BF1A38A-3C0D-4452-9FE7-BC307BE87974}",
15            "href": "/about-us/contact-us"
16          }
17        }
18      },
19      "linkRawValue": {
20        "value": "<link text=\"Aboutus\" anchor=\"anchor\" ... .. id=\"{5B...}\" />"
21      },
22      "linkTyped": {
23        "text": "About us",
24        "anchor": "anchor",
25        "target": "_blank",
26        "url": "/en/about-us/contact-us#anchor"
27      }
28    }
29  }
30}