import GraphApplyEditsResult from "@arcgis/core/rest/knowledgeGraph/GraphApplyEditsResult.js";
            const GraphApplyEditsResult = await $arcgis.import("@arcgis/core/rest/knowledgeGraph/GraphApplyEditsResult.js");
            @arcgis/core/rest/knowledgeGraph/GraphApplyEditsResult
        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
// 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
- 
  
  
  
  
  
  
  
  
    Parameterproperties ObjectoptionalSee the properties for a full list of the properties that may be passed into the constructor. 
Property Overview
| Name | Type | Summary | Class | 
|---|---|---|---|
| Returns a list of the Provenance entities that were deleted as a result of the executeApplyEdits() call with the  | GraphApplyEditsResult | ||
| Returns a list of objects for each relationship type that was deleted by as a result of deleting its origin or destination entity during an executeApplyEdits() call with the  | GraphApplyEditsResult | ||
| The name of the class. | Accessor | ||
| Returns a list of objects for each entity type or relationship type that added, updated or deleted records by executeApplyEdits(). | GraphApplyEditsResult | ||
| The error message explaining information about why executeApplyEdits() failed. | GraphApplyEditsResult | ||
| If  | GraphApplyEditsResult | 
Property Details
- 
  
  cascadeProvenanceDeleteResultsPropertycascadeProvenanceDeleteResults CascadeProvenanceDeleteResults[]
- 
  
    Returns a list of the Provenance entities that were deleted as a result of the executeApplyEdits() call with the cascadeProvenanceDeletesoption enabled.If hasError is true,cascadeProvenanceDeleteswill be empty.ExamplecascadeProvenanceDeleteResults:[{ id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} }]
- 
  
  cascadeRelationshipDeleteResultsPropertycascadeRelationshipDeleteResults CascadeRelationshipDeleteResults[]
- 
  
    Returns a list of objects for each relationship type that was deleted by as a result of deleting its origin or destination entity during an executeApplyEdits() call with the cascadeDeletesoption enabled.If hasError is true,cascadeRelationshipDeleteswill be empty.ExamplecascadeRelationshipDeleteResults:[{ typeName: "supplies", cascadeRelationshipDeletes: [ { id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} originId: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", destinationId: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}" } ] }]
- 
  
  editResultsPropertyeditResults 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,editResultswill be empty.ExampleeditResults:[{ 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: ""} }] }],
- 
  
    The error message explaining information about why executeApplyEdits() failed. Will only be defined if hasError is true.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." } }
- 
  
  hasErrorPropertyhasError Boolean
- 
  
    If truethere was an error processing executeApplyEdits(). The error message is captured in the error property.- Default Value:false
 
Method Overview
| Name | Return Type | Summary | Class | 
|---|---|---|---|
| Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
| Returns true if a named group of handles exist. | Accessor | ||
| Removes a group of handles owned by the object. | Accessor | 
Method Details
- 
  
  
  
  Inherited from Accessor
- 
  
  
    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 } ); this.addHandles(handle); // Destroy the object this.destroy();ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed. groupKey *optionalKey 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. 
- 
  
  hasHandlesInheritedMethodhasHandles(groupKey){Boolean}Inherited from Accessor
- 
  
  
    Returns true if a named group of handles exist. ParametergroupKey *optionalA group key. ReturnsType Description Boolean Returns trueif 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"); }
- 
  
  
  
  Inherited from Accessor
- 
  
  
    Removes a group of handles owned by the object. ParametergroupKey *optionalA group key or an array or collection of group keys to remove. Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
Type Definitions
- 
  
  CascadeProvenanceDeleteResultsType DefinitionCascadeProvenanceDeleteResults Object
- 
  
    CascadeProvenanceDeleteResults contains the idof the Provenance GraphNamedObject that was deleted from the KnowledgeGraph as well as any errors that occurred during the operation, when edits were applied withcascadeProvenanceDeleteset to true.Example// typical structure { id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", //id of Provenance entity deleted error: {errorCode: 0, errorMessage: ""} }
- 
  
  CascadeRelationshipDeleteResultsType DefinitionCascadeRelationshipDeleteResults Object
- 
  
    cascadeRelationshipDeletesResults returns a list of all relationships of each type that were deleted from the KnowledgeGraph due to one of their endpoints being deleted, as well as any errors that occurred during the operation. - Properties
- 
  typeName StringThe name of the RelationshipType that had deleted relationships. cascadeRelationshipDeletes NamedObjectCascadeRelationshipDeleteResults[]A list of objects containing the id, origin id, destination id and error information for every deleted relationship. 
 Example{ typeName: "supplies", cascadeRelationshipDeletes: [ { id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} originId: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", destinationId: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}" } ] }
- 
  
  NamedObjectCascadeRelationshipDeleteResultsType DefinitionNamedObjectCascadeRelationshipDeleteResults Object
- 
  
    NamedObjectCascadeRelationshipDeleteResults contains the idof the Relationship that was deleted from the KnowledgeGraph along with its origin id, destination id and error information.- Properties
- 
  id StringThe id of the Relationship that was added, updated or deleted from the knowledge graph due to a cascaded Entity delete. originId StringThe id of the origin entity of the deleted relationship. destinationId StringThe id of the destination entity of the deleted relationship. optionalerror ErrorIndicates any errors caused during the operation applied to this object. 
 Example// typical structure { id: "{FB74F4DD-CBD7-4C94-BA89-0C044ECCC273}", error: {errorCode: 0, errorMessage: ""} originId: "{AN4E4G85-41F1-49A4-8412-CACCC9906E88}", destinationId: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}" }
- 
  
  NamedObjectEditResultsType DefinitionNamedObjectEditResults Object
- 
  
    NamedObjectEditResults contains the idof 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 StringThe id of the Entity or Relationship that was added, updated or deleted from the knowledge graph. optionalerror ErrorIndicates any errors caused during the operation applied to this object. 
 Example// typical structure { id: "{2WS8F4SA-41F1-S1E8-8412-F2G5S4D8GE1S}", //id of entity or relationship added, updated or deleted error: {errorCode: 0, errorMessage: ""} }
- 
  
  editResultsObjectType DefinitioneditResultsObject 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 StringThe 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. updates NamedObjectEditResults[]A list of objects containing the id and error information for every updated entity or relationship. deletes NamedObjectEditResults[]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: ""} }] }