Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed retrieval of neptune graph summary to use axios http request #38

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/NeptuneSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { aws4Interceptor } from "aws4-axios";
import { fromNodeProviderChain } from "@aws-sdk/credential-providers";
import { NeptunedataClient, ExecuteOpenCypherQueryCommand } from "@aws-sdk/client-neptunedata";
import { loggerDebug, loggerError, loggerInfo, yellow } from "./logger.js";
import { ExecuteQueryCommand, GetGraphSummaryCommand, NeptuneGraphClient } from "@aws-sdk/client-neptune-graph";
import { ExecuteQueryCommand, NeptuneGraphClient } from "@aws-sdk/client-neptune-graph";

const NEPTUNE_DB = 'neptune-db';
const NEPTUNE_GRAPH = 'neptune-graph';
Expand Down Expand Up @@ -366,14 +366,13 @@ function getNeptuneGraphClient() {
*/
async function getNeptuneGraphSummary() {
loggerInfo('Retrieving ' + NEPTUNE_GRAPH + ' summary')
const client = getNeptuneGraphClient();
const command = new GetGraphSummaryCommand({
graphIdentifier: NAME,
mode: 'detailed'
let response = await axios.get(`https://${HOST}:${PORT}/summary`, {
params: {
mode: 'detailed'
}
});
const response = await client.send(command);
loggerInfo('Retrieved ' + NEPTUNE_GRAPH + ' summary')
return response.graphSummary;
return response.data.graphSummary;
}

/**
Expand Down