You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: products/analytics/src/content/graphql-api/getting-started/explore-graphql-schema.md
+21-17Lines changed: 21 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,62 +7,66 @@ order: 40
7
7
8
8
One of the great features of a GraphQL API is that it offers "introspection"—you can explore the graph (by making API calls) to see the available data sets, the fields and their types, and the operations you can perform.
9
9
10
-
_GraphiQL_ uses this functionality to provide a "Documentation Explorer" that you can use to understand the schema. Click on the **Docs** link on the right-hand side and then drill down, starting with `query` and proceeding to `viewer`and then `zone`. GraphiQL also uses introspection to provide query auto-complete and syntax validation.
10
+
[GraphiQL]([GraphiQL](https://github.com/graphql/graphiql/tree/main/packages/graphiql#readme)) uses introspection to provide the **Documentation Explorer** so that you can visually browse the Analytics schema, including available data sets (nodes) and available fields.
11
11
12
-
You can explore the schema of the Coudflare GraphQL endpoint in a GraphQL client. The examples below use the GraphiQL client.
12
+
This article provides an introduction to the GraphQL Documentation Explorer.
13
13
14
-
Before you begin, configure the API endpoint and HTTP headers in the GraphQL client.
14
+
## Prerequisites
15
15
16
-
## Use the Documentation Explorer
16
+
Before you begin, [configure the API endpoint and HTTP headers](/graphql-api/getting-started/authentication/graphql-client-headers) in the GraphQL client.
17
17
18
-
Click **Docs** to open the **Documentation Explorer** pane.
18
+
## Open the Documentation Explorer
19
19
20
-
A list of available nodes displays. The nodes in the list follow this syntax:
20
+
To open the GraphiQL Documentation Explorer, click the **Docs** link in header of the response pane:
A list of available objects displays. The objects in the list follow this syntax:
21
25
22
26
```
23
-
node-name: node-type-definition
27
+
object-name: object-type-definition
24
28
```
25
29
26
-
## Find the type definition of a node
30
+
## Find the type definition of an object
27
31
28
-
When you first open the **Documentation Explorer** pane, the **mutation** and `query`nodes display:
32
+
When you first open the **Documentation Explorer** pane, the `mutation` and `query`root types display:
29
33
30
34

31
35
32
-
In this example `query` is the name of the node, and `Query` is the type definition of the node.
36
+
In this example `query` is the name of a root, and `Query` is the type definition.
33
37
34
38
## Find the fields available for a given type definition
35
39
36
40
Click on the **type definition** of a node to view the fields that it provides. The **Documentation Explorer** pane also displays descriptions of the nodes.
37
41
38
-
Click the `Query` type definition. The **Documentation Explorer** panel displays the fields that the `query` node provides. In this example, the fields are `cost` and `viewer`.
42
+
For example, click the **Query** type definition. The **Documentation Explorer** panel displays the fields that Query` provides. In this example, the fields are `cost` and `viewer`.
39
43
40
44

41
45
42
46
## Find the arguments associated with a field
43
47
44
-
Click on the type definition of the `viewer` field to list its sub-fields. The `viewer` field provides sub-fields that allow you to query `accounts` or `zones` data:
48
+
Click the type definition of the `viewer` field to list its sub-fields. The `viewer` field provides sub-fields that allow you to query `accounts` or `zones` data:
The `accounts` and `zones` fields take arguments to specify which data set to query.
49
53
50
-
For the `zones`node you can provide a filter of `ZoneFilter_InputObject` type. To view the fields available to filter, click **ZoneFilter_InputObject**.
54
+
For example, the `zones` can take a filter of `ZoneFilter_InputObject` type as an argument. To view the fields available to filter, click **ZoneFilter_InputObject**.
51
55
52
56
To limit the amount of search results that the query returns, click the **limit** argument.
53
57
54
58
## Find the search nodes available for a zone
55
59
56
-
To view a list of the search nodes available for a zone, click on the `zones` type definition after the colon (`:`) in the `zones` field:
60
+
To view a list of the data sets available for a zone, click on the `zones` type definition after the colon (`:`) in the `zones` field:
57
61
58
62

59
63
60
-
A list of **search nodes**appears, with a brief description of their behavior and a list of valid arguments. Arguments that end with an exclamation mark (`!`) are required.
64
+
A list of **search nodes**displays, with a brief description of their behavior and a list of valid arguments. Arguments that end with an exclamation mark (`!`) are required.
Refer to [Data Sets (tables)](/graphql-api/features/data-sets) for details on nomenclature and behavior of these nodes.
68
+
Refer to [_Data Sets (tables)_](/graphql-api/features/data-sets) for details on nomenclature and behavior of these nodes.
65
69
66
-
To view the fields that a node provides, click on its type definition. If you click on the **ZoneFirewallEventsAdaptive** type definition in the **firewallEventsAdaptive** node, a list of fields is displayed:
70
+
To view the fields available for a particular data set, click on its type definition. If you click on the **ZoneFirewallEventsAdaptive** type definition in the **firewallEventsAdaptive** node, a list of fields is displayed:
67
71
68
72

0 commit comments