@@ -4,7 +4,7 @@ export interface GraphObjectFilter {
44 _type : string ;
55}
66
7- export type GraphObjectIteratee < T > = ( obj : T ) => void | Promise < void > ;
7+ export type GraphObjectIteratee < T > = ( obj : Readonly < T > ) => void | Promise < void > ;
88export type GraphObjectIterateeOptions = {
99 concurrency ?: number ;
1010} ;
@@ -104,6 +104,11 @@ export interface JobState {
104104 * have run and therefore entities collected by those other steps should not
105105 * be expected to exist.
106106 *
107+ * The graph object parameter passed to the iteratee is marked as Readonly.
108+ * Once created and added to the JobState, graph objects should be considered immutable.
109+ * Modifying a graph object during iteration can result in undesirable behavior
110+ * since objects are upload to JupiterOne at non-regular intervals.
111+ *
107112 * If concurrency is specified (defaults to 1), the iteratee will be executed
108113 * concurrently for graph objects that are found in memory and for
109114 * graph objects found in a given graph file. No specific ordering is guaranteed.
@@ -136,6 +141,11 @@ export interface JobState {
136141 * may not have run and therefore relationships collected by those other steps
137142 * should not be expected to exist.
138143 *
144+ * The graph object parameter passed to the iteratee is marked as Readonly.
145+ * Once created and added to the JobState, graph objects should be considered immutable.
146+ * Modifying a graph object during iteration can result in undesirable behavior
147+ * since objects are upload to JupiterOne at non-regular intervals.
148+ *
139149 * If concurrency is specified (defaults to 1), the iteratee will be executed
140150 * concurrently for graph objects that are found in memory and for
141151 * graph objects found in a given graph file. No specific ordering is guaranteed.
0 commit comments