Infer edge connections from graph exploration#1742
Merged
Conversation
9fd75d0 to
d9208c2
Compare
arseny-kostenko
approved these changes
May 4, 2026
acarbonetto
approved these changes
May 4, 2026
updateSchemaFromEntities now accepts an optional vertexLookup parameter to infer EdgeConnection entries from edges and their endpoint vertex types. This makes the Schema Explorer show relationships discovered through exploration without waiting for the database summary API. Closes aws#1720
d9208c2 to
59b7c8b
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When users explore the graph and edges are returned from queries, the edge types are correctly added to the schema, but the edge connections (source vertex type → edge type → target vertex type) are not inferred. This means the Schema Explorer diagram does not show new relationships discovered through exploration until the database summary API catches up.
vertexLookupparameter toupdateSchemaFromEntitiesto inferEdgeConnectionentries from edges and their endpoint vertex typesVertexTypeLookupinterface withcreateVertexTypeLookupfactory that chains existingMap<VertexId, Vertex>instances with O(1) construction (no copying)mergeEdgeConnectionsfunction handles multi-label vertices, deduplication, and preserves existing connections (including theircount)createEdgeConnectionhelper for constructingEdgeConnectionobjects from plain stringsuseAddToGraph,useUpdateSchemaFromEntities,FakeExplorer) to build and pass the vertex lookup from the entity batch + canvas state, with batch vertices taking priorityValidation
createVertexTypeLookup(chaining, priority, isEmpty, unknown IDs)useAddToGraphanduseUpdateSchemaFromEntitiesverifying end-to-end inference and batch-over-canvas prioritypnpm checkspasses (lint, format, types)Related Issues
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.