GraphApplyEditsResult

AMD: require(["esri/rest/knowledgeGraph/GraphApplyEditsResult"], (GraphApplyEditsResult) => { /* code goes here */ });
ESM: import GraphApplyEditsResult from "@arcgis/core/rest/knowledgeGraph/GraphApplyEditsResult";
Class: esri/rest/knowledgeGraph/GraphApplyEditsResult
Inheritance: GraphApplyEditsResult Accessor
Since: ArcGIS API for JavaScript 4.25
beta

The result of an executeApplyEdits() performed on a knowledge graph service's graph resource. Summarizes the edits to the graph and provides any errors encountered in performing the edits.

See also
Examples
// sample executeApplyEdits() to add a new entity
const newEntity = new Entity({
  typeName: "Supplier",
  properties: {
    Name: "Supplier 5",
    EmployeeCount: 681
  }
})

KnowledgeGraphModule.executeApplyEdits(graph, {
  entityAdds: [newEntity],
})
.then((editResult) => {
  console.log("Graph Add Result", editResult);
});
// Results of adding one entity to the `Supplier` entity type
{
  editResults:[{
    adds:[
    {
      id: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    deletes:[],
    typeName: "Supplier",
    updates:[]
  }],
  hasError: false,
  error: undefined
}
// example results of a complex executeApplyEdits that involved
// adding, updating and deleting multiple types.
{
  editResults:[{
    adds:[
    {
      id: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    deletes:[],
    typeName: "Supplier",
    updates:[]
  },{
    adds:[{
      id: "{ANWIFHSAS-AW6F-G9W4-8412-A1A8W4F1A5S6F}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    deletes:[{
      id: "{AN4E4G85-Q15F4-49A4-8412-A1W8F4S6A5S4}",
      error: {errorCode: 0, errorMessage: ""}
    },{
      id: "{AF15W4F8S-A1W5-A1W8F-G1E8-AF1W5F4S8F4W}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    typeName: "Part",
    updates:[{
      id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}",
      error: {errorCode: 0, errorMessage: ""}
    }]
  }],
  hasError: false,
  error: undefined
}
// example of an error message due to misspelled entity type
{
  editResults:[],
  hasError: true,
  error: {
    errorCode: 112020,
    errorMessage: "The Entity/Relationship type definition, Suppplier, was not found."
  }
}

Constructors

new GraphApplyEditsResult()
Property
properties Object
optional

See the properties for a full list of the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
String

The name of the class.

more details
Accessor
editResultsObject[]

Returns a list of objects for each entity type or relationship type that added, updated or deleted records by executeApplyEdits().

more details
GraphApplyEditsResult
Object

The error message explaining information about why executeApplyEdits() failed.

more details
GraphApplyEditsResult
Object

If true there was an error processing executeApplyEdits().

more details
GraphApplyEditsResult

Property Details

declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

editResults editResultsObject[]

Returns a list of objects for each entity type or relationship type that added, updated or deleted records by executeApplyEdits().

If hasError is true, editResults will be empty.

Example
editResults:[{
    adds:[
    {
      id: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    deletes:[],
    typeName: "Supplier",
    updates:[]
  },{
    adds:[{
      id: "{ANWIFHSAS-AW6F-G9W4-8412-A1A8W4F1A5S6F}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    deletes:[{
      id: "{AN4E4G85-Q15F4-49A4-8412-A1W8F4S6A5S4}",
      error: {errorCode: 0, errorMessage: ""}
    },{
      id: "{AF15W4F8S-A1W5-A1W8F-G1E8-AF1W5F4S8F4W}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    typeName: "Part",
    updates:[{
      id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}",
      error: {errorCode: 0, errorMessage: ""}
    }]
}],
error Object

The error message explaining information about why executeApplyEdits() failed. Will only be defined if hasError is true.

Properties
errorCode int

Error code returned from the server.

errorMessage String

Description of the error.

Example
// example of an error message due to misspelled entity type
{
  editResults:[],
  hasError: false,
  error: {
    errorCode: 112020,
    errorMessage: "The Entity/Relationship type definition, Suppplier, was not found."
  }
}
hasError Object

If true there was an error processing executeApplyEdits(). The error message is captured in the error property.

Default Value:false

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

more details
Accessor
Boolean

Returns true if a named group of handles exist.

more details
Accessor

Removes a group of handles owned by the object.

more details
Accessor

Method Details

addHandles(handleOrHandles, groupKey)inherited

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

// Handle gets removed when the object is destroyed.
this.addHandles(handle);
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

hasHandles(groupKey){Boolean}inherited

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}
removeHandles(groupKey)inherited

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

Type Definitions

editResultsObject Object

editResultsObject returns a list of all entities and relationships of each type that was added, updated or deleted from the KnowledgeGraph as well as any errors that occurred during the operation.

Properties
typeName String

The name of the EntityType or RelationshipType that had changed items.

A list of objects containing the id and error information for every added entity or relationship.

A list of objects containing the id and error information for every updated entity or relationship.

A list of objects containing the id and error information for every deleted entity or relationship.

Example
{
  adds:[{
      id: "{ANWIFHSAS-AW6F-G9W4-8412-A1A8W4F1A5S6F}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    deletes:[{
      id: "{AN4E4G85-Q15F4-49A4-8412-A1W8F4S6A5S4}",
      error: {errorCode: 0, errorMessage: ""}
    },{
      id: "{AF15W4F8S-A1W5-A1W8F-G1E8-AF1W5F4S8F4W}",
      error: {errorCode: 0, errorMessage: ""}
    }],
    typeName: "Part",
    updates:[{
      id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}",
      error: {errorCode: 0, errorMessage: ""}
    }]
}
NamedObjectEditResults Object

NamedObjectEditResults contains the id of the GraphNamedObject (Entity or Relationship) that was added, updated or deleted from the KnowledgeGraph as well as any errors that occurred during the operation.

Properties
id String

The id of the Entity or Relationship that was added, updated or deleted from the knowledge graph.

error Object

Indicates any errors caused during the operation applied to this object.

Specification
errorCode int

Error code returned from the server.

errorMessage String

Description of the error.

Example
// typical structure
{
  id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", //id of entity or relationship added, updated or deleted
  error: {errorCode: 0, errorMessage: ""}
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.