Skip to content
Developerhome
X3

Mutations based on Sage X3 Classes

  Less than to read

In GraphQL, mutations are used to modify the data on the server with a request sent to the Sage X3 operation through the Syracuse server. A success or failure response is returned by the server.

To create a GraphQL mutation based on an existing Sage X3 class, you’ll need a class from the Classes function (GESACLA). The table APIOPE (API operation) will be implemented by the function.

Use the Operations function (GESAPIOPE) to link the class to API nodes. Start creating an operation and choose:

  • Mutation Type = Create/Update/Delete,
  • Operation Method = Class

Then create the operation as usual, same as in the Windows classes. In the Class section you’ll need these fields:

| Field Name | Description | |—|—| | Selection (CLASELECT) | Select this checkbox to validate the properties to map on the class fields.
New fields added afterward in the class definition will be displayed on the associated API operation but unselected. It will then be possible to set the corresponding property names from the node and mark the new class properties as selected for the mapping.
You can save the operation even if a mandatory property is missing from the mapping, but you won’t be able to activate it. | | Node name (CLANODE) | This column indicates the node the property belongs to. | | Binding (CLABIND) | When you select the class, the fields to map are automatically loaded in the Binding column. | | Property (CLAPROPNAM) | The property names are automatically loaded if you correctly configure the class and reference tables. | | Type (CLATYP) | This column indicates the property’s data type. | | Dimension (CLADIME) | This field indicates the number of dimensions defined and managed in the class for the property. | | Denormalized collection (CLADENCOLGR) | Enter the name of the denormalized collection to which this property belongs. | | Local menu number (CLANOLIB) | This column displays the local menu related to the fields if there is one. | | Join type (CLAKINDREF) | This field is editable only for collections defined in a class definition, and if this line is for collection. Enter the collection name in the Property column and select Collection on the same line for your collection’s parent level. After you fill property, system will automatically fill field Parent property (CLPARENTPROP) for all fields below which belong to this collection. The parent level must be on the line just above the collection. If multiple collections are under the same parent node, then you have to define this parent line for each collection. | | Parent property (CLPARENTPROP) | Use this field to configure your collections.
Enter the collection’s name defined at the parent level in the collection’s Property column. | | Order (CLANUMFLD) | This field displays the Order value assigned to this property in the Classes function (GESACLA). | | Description (CLAINTIT) | This field displays the short description for your property. | | Length (CLALONG) | This column indicates the display length of the field on the screen. | | Activity code (CLACODACT) | An activity code is used to: Make an element optional in the dictionary if the value associated with the activity code is null, Identify the specific/custom elements if they are marked with a code starting with X, Y, or Z | | Mandatory (CLAOBLIG) | Select this checkbox to make the field mandatory. | | Table (CLATABLE) | This column indicates the table related to the field. | | Collection (CLAFLDGRP) | Enter the name of the collection to which this property belongs. | | Linked table (CLALNKTAB) | This column indicates the table related to the collection. |