Skip to content

Commit

Permalink
Do not clear isFetching state for subscriptions until they complete
Browse files Browse the repository at this point in the history
Fixes: #2774
  • Loading branch information
simhnna committed Sep 23, 2022
1 parent d483502 commit fc0d949
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/graphiql-react/src/execution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,9 @@ export function ExecutionContextProvider(props: ExecutionContextProviderProps) {
};
}

setIsFetching(false);
setResponse(formatResult(fullResponse));
} else {
const response = formatResult(result);
setIsFetching(false);
setResponse(response);
}
};
Expand Down Expand Up @@ -294,6 +292,9 @@ export function ExecutionContextProvider(props: ExecutionContextProviderProps) {
}
} else {
handleResponse(value);
if (queryId === queryIdRef.current) {
setIsFetching(false);
}
}
} catch (error) {
setIsFetching(false);
Expand Down

0 comments on commit fc0d949

Please sign in to comment.