Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Modified HTTP API to expect gremlin-lang strings for parameters and update all GLVs to send requests in new format.
* Added string parameter parsing to `GremlinServer` to prevent traversal injection and excessive nesting depths.
* Modified all GLVs to detect unsupported types in `GremlinLang` and throw consistent error for that case.
* Relaxed `GValue` name validation by removing the reserved leading underscore restriction.
* Added GraphBinary 4.0 `Graph` (`0x10`) serializer/deserializer to `gremlin-javascript`, `gremlin-dotnet`, and `gremlin-go` so that `subgraph()` results are returned as a detached `Graph` data container.

[[release-4-0-0-beta-2]]
Expand Down
15 changes: 12 additions & 3 deletions docs/src/reference/gremlin-variants.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ the traversal to utilize a parameter in place of a literal.

[source,go]
----
g.V().Has("name", gremlingo.NewGValue("name", "marko"))
g.V().Has("name", gremlingo.GValue{Name: "name", Value: "marko"})
----

[[gremlin-go-scripts]]
Expand Down Expand Up @@ -1852,8 +1852,17 @@ Promise.all([
[[gremlin-javascript-gvalue]]
=== GValue Parameterization

IMPORTANT: 4.0.0-beta.2 Release - `GValue` parameterization is not yet implemented for the JavaScript driver. This
functionality is planned for a future release.
A `GValue` is an encapsulation of a parameter name and value. A <<traversal-parameterization,subset of gremlin steps>>
are able to accept GValues. When constructing a `GraphTraversal` with such steps in JavaScript, a GValue may be passed
in the traversal to utilize a parameter in place of a literal.

[source,javascript]
----
const GValue = gremlin.process.GValue;

g.V().has('name', new GValue('name', 'marko'));
g.mergeV(new GValue('vertexPattern', { name: 'marko' }));
----

[[gremlin-javascript-scripts]]
=== Submitting Scripts
Expand Down
16 changes: 16 additions & 0 deletions docs/src/upgrade/release-4.x.x.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,22 @@ beyond this limit will be rejected with an error.

See: link:https://issues.apache.org/jira/browse/TINKERPOP-3247[TINKERPOP-3247]

==== GValue in the Language Variants

`GValue`, the named query-parameter wrapper introduced for Java in 3.8.0, is now available as a client-side API in all
of the Gremlin Language Variants. Users of the Python, JavaScript, .NET, and Go drivers can construct a `GValue` and
pass it to a parameterizable step; the driver sends the value to the server as a named parameter rather than inlining
it as a literal. See the "GValue Parameterization" reference documentation for
link:https://tinkerpop.apache.org/docs/4.0.0/reference/#gremlin-java-gvalue[Java],
link:https://tinkerpop.apache.org/docs/4.0.0/reference/#gremlin-python-gvalue[Python],
link:https://tinkerpop.apache.org/docs/4.0.0/reference/#gremlin-javascript-gvalue[JavaScript],
link:https://tinkerpop.apache.org/docs/4.0.0/reference/#gremlin-dotnet-gvalue[.NET], and
link:https://tinkerpop.apache.org/docs/4.0.0/reference/#gremlin-go-gvalue[Go] for construction syntax and examples.

The leading-underscore restriction on `GValue` names that was present in 3.8.0 has been removed. Parameter names
beginning with `_` are now accepted in Java and across all language variants. The only remaining constraints are that
a `GValue` may not wrap another `GValue`, and (in the non-Java drivers) its name may not be null.

==== JavaScript Typed Numeric Wrappers

JavaScript has a single `Number` type (IEEE 754 double) which loses the distinction between Gremlin numeric types like
Expand Down
Loading