Skip to content

Commit 8fbfc9a

Browse files
authored
Fix auto sync on connection change (#919)
1 parent 97552d9 commit 8fbfc9a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
([#896](https://github.com/aws/graph-explorer/pull/896))
1717
- **Updated** to use the React Compiler to improve performance and simplify code
1818
([#916](https://github.com/aws/graph-explorer/pull/916))
19+
- **Fixed** issue where a schema sync would not automatically run when a
20+
connection was changed
21+
([#919](https://github.com/aws/graph-explorer/pull/919))
1922

2023
## Release v1.15.0
2124

packages/graph-explorer/src/modules/CreateConnection/CreateConnection.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
DEFAULT_NODE_EXPAND_LIMIT,
3535
} from "@/utils/constants";
3636
import { useAtomCallback } from "jotai/utils";
37+
import { useQueryClient } from "@tanstack/react-query";
3738

3839
type ConnectionForm = {
3940
name?: string;
@@ -85,6 +86,7 @@ const CreateConnection = ({
8586
onClose,
8687
}: CreateConnectionProps) => {
8788
const styleWithTheme = useWithTheme();
89+
const queryClient = useQueryClient();
8890

8991
const configId = existingConfig?.id;
9092
const initialData: ConnectionForm | undefined = existingConfig
@@ -158,13 +160,16 @@ const CreateConnection = ({
158160
updatedGraphs.delete(configId);
159161
return updatedGraphs;
160162
});
163+
164+
await queryClient.resetQueries();
161165
}
162166
},
163167
[
164168
configId,
165169
initialData?.url,
166170
initialData?.graphDbUrl,
167171
initialData?.queryEngine,
172+
queryClient,
168173
]
169174
)
170175
);

0 commit comments

Comments
 (0)