11// assumption is that apis are giving json as output
22
3+ import useCanvasStore from 'stores/CanvasStore' ;
34import useCollectionStore from 'stores/CollectionStore' ;
45import { useTabStore } from 'stores/TabStore' ;
56import { computeAuthNode } from './compute/authnode' ;
@@ -69,7 +70,7 @@ class Graph {
6970
7071 if ( node . type === 'outputNode' ) {
7172 this . logs . push ( `Output: ${ JSON . stringify ( prevNodeOutputData ) } ` ) ;
72- node . data . setOutput ( prevNodeOutputData ) ;
73+ useCanvasStore . getState ( ) . setOutputNode ( node . id , prevNodeOutputData ) ;
7374 result = [ 'Success' , node , prevNodeOutput ] ;
7475 }
7576
@@ -94,7 +95,7 @@ class Graph {
9495 }
9596
9697 if ( node . type === 'authNode' ) {
97- this . auth = computeAuthNode ( node . data . auth , this . env ) ;
98+ this . auth = node . data . type ? computeAuthNode ( node . data , this . env ) : undefined ;
9899 result = [ 'Success' , node , prevNodeOutput ] ;
99100 }
100101
@@ -134,7 +135,7 @@ class Graph {
134135 // reset every output node for a fresh run
135136 this . nodes . forEach ( ( node ) => {
136137 if ( node . type === 'outputNode' ) {
137- node . data . setOutput ( undefined ) ;
138+ useCanvasStore . getState ( ) . unSetOutputNode ( node . id ) ;
138139 }
139140 } ) ;
140141 this . graphRunNodeOutput = { } ;
0 commit comments