Skip to content

TINKERPOP-3247 Convert request bindings to gremlin-lang string format#3402

Merged
kenhuuu merged 2 commits into
masterfrom
stringify-params
May 11, 2026
Merged

TINKERPOP-3247 Convert request bindings to gremlin-lang string format#3402
kenhuuu merged 2 commits into
masterfrom
stringify-params

Conversation

@kenhuuu
Copy link
Copy Markdown
Contributor

@kenhuuu kenhuuu commented Apr 27, 2026

https://issues.apache.org/jira/browse/TINKERPOP-3247

Moving parameters from binary-serialized maps to string representations
makes the request side pure text, decoupling Gremlin language evolution
from GraphBinary versioning. New types can be introduced in minor/patch
versions without touching GraphBinary, eliminating the need for a major
version bump across the ecosystem for every new request-side type.

The asParameter() fallback is replaced with an unsupportedType flag that
records the class name and falls back to toString(). A flag is used
rather than throwing because embedded Traversals build GremlinLang as a
side effect but never send it, so unknown types must not break
execution. All other GLVs throw immediately since they have no embedded
mode and the early throw gives better errors.

Client APIs accept both map and string bindings (but not both at the
same time) because users who use the Client directly with raw Gremlin
strings shouldn't need to hand-craft gremlin-lang map literals. Mixing
both throws immediately to prevent silent loss where one set of bindings
would be discarded.

Edge and VertexProperty tests that relied on the old asParameter
fallback were removed because they aren't supported in gremlin-lang.

@kenhuuu kenhuuu force-pushed the char-duration-binary branch from 316e283 to 8bed359 Compare May 4, 2026 16:26
Base automatically changed from char-duration-binary to master May 4, 2026 19:10
@kenhuuu kenhuuu force-pushed the stringify-params branch from 6b3e2fc to c7c2154 Compare May 4, 2026 23:21
Comment thread gremlin-js/gremlin-javascript/lib/driver/request-message.ts
@xiazcy
Copy link
Copy Markdown
Contributor

xiazcy commented May 8, 2026

VOTE +1 pending resolution of existing comments

The visitor treated all keyword map keys as their text representation,
so a null key in [null:"value"] was parsed as the String "null" instead
of Java null. This broke round-tripping maps with null keys through
GremlinLang serialization and ANTLR parsing.
@kenhuuu kenhuuu force-pushed the stringify-params branch from 6d737e0 to 12066cf Compare May 8, 2026 22:27
@kenhuuu
Copy link
Copy Markdown
Contributor Author

kenhuuu commented May 8, 2026

VOTE +1

@Cole-Greer
Copy link
Copy Markdown
Contributor

VOTE +1

Moving parameters from binary-serialized maps to string representations
makes the request side pure text, decoupling Gremlin language evolution
from GraphBinary versioning. New types can be introduced in minor/patch
versions without touching GraphBinary, eliminating the need for a major
version bump across the ecosystem for every new request-side type.

The asParameter() fallback is replaced with an unsupportedType flag that
records the class name and falls back to toString(). A flag is used
rather than throwing because embedded Traversals build GremlinLang as a
side effect but never send it, so unknown types must not break
execution. All other GLVs throw immediately since they have no embedded
mode and the early throw gives better errors.

Client APIs accept both map and string bindings (but not both at the
same time) because users who use the Client directly with raw Gremlin
strings shouldn't need to hand-craft gremlin-lang map literals. Mixing
both throws immediately to prevent silent loss where one set of bindings
would be discarded.

Edge and VertexProperty tests that relied on the old asParameter
fallback were removed because they aren't supported in gremlin-lang.

Assisted-by: Kiro:claude-opus-4-6
@kenhuuu kenhuuu force-pushed the stringify-params branch from 12066cf to 182daa3 Compare May 11, 2026 20:18
@kenhuuu kenhuuu merged commit 39ce320 into master May 11, 2026
41 of 43 checks passed
@kenhuuu kenhuuu deleted the stringify-params branch May 11, 2026 21:00
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.

3 participants