GQL data types Stay organized with collections Save and categorize content based on your preferences.
Graph Query Language (GQL) supports all GoogleSQLdata types,including the following GQL-specific data type:
Graph data types list
| Name | Summary |
|---|---|
| Graph element type | An element in a property graph. SQL type name: GRAPH_ELEMENT |
| Graph path type | A path in a property graph. SQL type name: GRAPH_PATH |
Graph element type
| Name | Description |
|---|---|
GRAPH_ELEMENT | An element in a property graph. |
A variable with aGRAPH_ELEMENT type is produced by a graph query.The generated type has this format:
GRAPH_ELEMENT<T>A graph element is either a node or an edge, representing data from amatching node or edge table based on its label. Each graph element holds aset of properties that can be accessed with a case-insensitive name,similar to fields of a struct.
Graph elements with dynamic properties enabledcan store properties beyond those defined in the schema. A schema changeisn't needed to manage dynamic properties because theproperty names and values are based on the input column's values. You can accessdynamic properties with their names in the same way as defined properties. Forinformation about how to model dynamic properties, seedynamic properties definition.
If a property isn't defined in the schema, accessing itthrough thefield-access-operator returns theJSONtype if the dynamic property exists, orNULL if the property doesn't exist.
Example
In the following example,n represents a graph element in theFinGraph property graph:
GRAPHFinGraphMATCH(n:Person)RETURNn.nameGraph path type
| Name | Description |
|---|---|
GRAPH_PATH | A path in a property graph. |
The graph path data type represents a sequence of nodes interleavedwith edges and has this format:
GRAPH_PATH<NODE_TYPE,EDGE_TYPE>You can construct a graph path with thePATH function or when you create apath variable in a graph pattern.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.