Skip to content

Switch schema sync summary API from detailed to basic mode#1791

Open
kmcginnes wants to merge 1 commit into
mainfrom
switch-summary-api-to-basic-mode
Open

Switch schema sync summary API from detailed to basic mode#1791
kmcginnes wants to merge 1 commit into
mainfrom
switch-summary-api-to-basic-mode

Conversation

@kmcginnes
Copy link
Copy Markdown
Collaborator

@kmcginnes kmcginnes commented May 28, 2026

Description

Schema Sync previously requested Neptune's summary API with mode=detailed, which returns nodeStructures and edgeStructures that Graph Explorer never uses (they lack label association, so they can't map to GE's label-centric schema model). This switches to mode=basic which returns all the fields GE actually consumes: nodeLabels, edgeLabels, numNodes, numEdges.

Additionally, the proxy server was hardcoding ?mode=detailed on all three summary endpoints instead of forwarding client query params. It now passes req.url directly to the upstream URL resolver, which naturally includes any query string the client sent.

How to read the changes:

  1. app.ts (proxy) — resolveEndpointUrl relaxed to accept leading slashes; summary handlers now just forward req.url as-is
  2. gremlinExplorer.ts, openCypherExplorer.ts, sparqlExplorer.ts — one-line URL change each (detailedbasic)
  3. Test files — new explorer-level tests + updated proxy assertions

Validation

  • Manually tested against a Neptune database — schema sync works correctly with basic mode
  • pnpm checks passes (lint, format, types)
  • pnpm test passes (1709 tests including 8 new ones)
  • New tests cover: correct URL is called, multiple query params forwarded, fallback to query-based discovery works when summary API fails

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

@kmcginnes kmcginnes force-pushed the switch-summary-api-to-basic-mode branch 9 times, most recently from b0e1518 to 3ed615a Compare May 29, 2026 01:37
Basic mode returns all fields Graph Explorer uses (nodeLabels,
edgeLabels, numNodes, numEdges) without the unused nodeStructures
and edgeStructures. Also makes the proxy forward query params
as-is instead of hardcoding mode=detailed.

Removes broken lint-staged config from graph-explorer sub-package
(referenced removed eslint; root config already handles linting).

Closes #1789
@kmcginnes kmcginnes force-pushed the switch-summary-api-to-basic-mode branch from 3ed615a to 27c99e5 Compare May 29, 2026 16:07
@kmcginnes kmcginnes marked this pull request as ready for review May 29, 2026 16:14

try {
const res = await fetch(url.href, options);
const res = await fetch(url.href, options); // lgtm[js/request-forgery]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch schema sync summary API from detailed to basic mode

3 participants