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_ELEMENTtype 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 a
matching node or edge table based on its label. Each graph element holds a
set of properties that can be accessed with a case-insensitive name,
similar to fields of a struct.
Graph elements with dynamic properties enabled
can store properties beyond those defined in the schema. A schema change
isn't needed to manage dynamic properties because the
property names and values are based on the input column's values. You can access
dynamic properties with their names in the same way as defined properties. For
information about how to model dynamic properties, seedynamic properties definition.
If a property isn't defined in the schema, accessing it
through thefield-access-operatorreturns theJSONtype if the dynamic property exists, orNULLif the property doesn't exist.
Example
In the following example,nrepresents a graph element in theFinGraphproperty graph:
GRAPHFinGraphMATCH(n:Person)RETURNn.name
Graph path type
Name
Description
GRAPH_PATH
A path in a property graph.
The graph path data type represents a sequence of nodes interleaved
with edges and has this format:
GRAPH_PATH<NODE_TYPE,EDGE_TYPE>
You can construct a graph path with thePATHfunction or when you create apath variablein a graph pattern.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# GQL data types\n\nGraph Query Language (GQL) supports all GoogleSQL [data types](/spanner/docs/reference/standard-sql/data-types),\nincluding the following GQL-specific data type:\n\nGraph data types list\n---------------------\n\nGraph element type\n------------------\n\nA variable with a `GRAPH_ELEMENT` type is produced by a graph query.\nThe generated type has this format: \n\n GRAPH_ELEMENT\u003cT\u003e\n\nA graph element is either a node or an edge, representing data from a\nmatching node or edge table based on its label. Each graph element holds a\nset of properties that can be accessed with a case-insensitive name,\nsimilar to fields of a struct.\n\nGraph elements with dynamic properties enabled\ncan store properties beyond those defined in the schema. A schema change\nisn't needed to manage dynamic properties because the\nproperty names and values are based on the input column's values. You can access\ndynamic properties with their names in the same way as defined properties. For\ninformation about how to model dynamic properties, see\n[dynamic properties definition](/spanner/docs/reference/standard-sql/graph-schema-statements#dynamic_properties_definition).\n\nIf a property isn't defined in the schema, accessing it\nthrough the [field-access-operator](/spanner/docs/reference/standard-sql/operators#field_access_operator) returns the `JSON`\ntype if the dynamic property exists, or `NULL` if the property doesn't exist.\n| **Note:** Names uniquely identify all properties in a graph element, case-insensitively. A defined property takes precedence over any dynamic property when their names conflict.\n\n**Example**\n\nIn the following example, `n` represents a graph element in the\n[`FinGraph`](/spanner/docs/reference/standard-sql/graph-schema-statements#fin_graph) property graph: \n\n GRAPH FinGraph\n MATCH (n:Person)\n RETURN n.name\n\nGraph path type\n---------------\n\nThe graph path data type represents a sequence of nodes interleaved\nwith edges and has this format: \n\n GRAPH_PATH\u003cNODE_TYPE, EDGE_TYPE\u003e\n\nYou can construct a graph path with the\n[`PATH`](/spanner/docs/reference/standard-sql/graph-gql-functions#path) function or when you create a\n[path variable](/spanner/docs/reference/standard-sql/graph-patterns#graph_pattern_definition) in a graph pattern."]]