Nodes
Less than to read
Nodes are GraphQL entities published out of Sage X3.
Nodes are one of the main concepts behind GraphQL that represent data as a graph of interconnected nodes.
Nodes can be “main” entities, or secondary entities such as linking nodes, or collections.
In Sage X3, the Data models function (GESAWM) is the first entry point to define GraphQL nodes since the base we need is a table or a set of tables with relationships.
Using the Data models function and not the Table dictionary itself to define a node also allows for the definition of multiple nodes based on the same table.
Metadata
New fields have been added to the Data models function to manage nodes. This can be found in Development > Data and parameters > API.
- Node (API) checkbox: Must be checked if the data dodel is meant to be published as a node.
- Node name: This indicates the name of the node the data model will be published as.
- Package name (API): Indicates which package the node belongs to.
- Ref. Data model (API) checkbox: When checked, this node will be used as a reference for foreign keys. Consequently, a unique node can be defined as a reference. This is optional.
- A left list has been added to filter data models related to nodes.
Naming convention
A standard Data Model created for a node is named API_TABLENAME_# with TABLENAME
being the name of the main table and # a sequence number used when there are more than one data model based on the same table.
Node names are written following the PascalCase naming convention, starting with a letter.
With the Data models function (GESAWM), you can also define the collections and standalone references (0:1 or 1:1 collection) for this node.