This is an automated email from the ASF dual-hosted git repository.
colegreer pushed a commit to branch 3.8-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/3.8-dev by this push:
new 46f940ec4c Updated gremlin-javascript to ues GraphBinary as default
instead of GraphSONv3 (#3101)
46f940ec4c is described below
commit 46f940ec4cc078089ae404352347543100e48e59
Author: Flora Jin <[email protected]>
AuthorDate: Tue Apr 29 12:07:35 2025 -0700
Updated gremlin-javascript to ues GraphBinary as default instead of
GraphSONv3 (#3101)
---
CHANGELOG.asciidoc | 1 +
.../javascript/gremlin-javascript/lib/driver/connection.js | 2 +-
.../javascript/gremlin-javascript/test/unit/client-test.js | 10 ++++++++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 678c8a15d2..aead724472 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -72,6 +72,7 @@ This release also includes changes from <<release-3-7-XXX,
3.7.XXX>>.
* Removed lambda oriented Gremlin testing from Gherkin test suite.
* Moved all lambda oriented Gremlin tests to `LambdaStepTest` in the Java test
suite.
* Removed the `@RemoteOnly` testing tag in Gherkin as lambda tests have all
been moved to the Java test suite.
+* Updated gremlin-javascript to use GraphBinary as default instead of
GraphSONv3
== TinkerPop 3.7.0 (Gremfir Master of the Pan Flute)
diff --git
a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js
index 96f82709fd..8f098957f0 100644
---
a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js
+++
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.js
@@ -39,7 +39,7 @@ const responseStatusCode = {
authenticationChallenge: 407,
};
-const defaultMimeType = 'application/vnd.gremlin-v3.0+json';
+const defaultMimeType = 'application/vnd.graphbinary-v1.0';
const graphSON2MimeType = 'application/vnd.gremlin-v2.0+json';
const graphBinaryMimeType = 'application/vnd.graphbinary-v1.0';
diff --git
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/client-test.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/client-test.js
index fee184fe69..b1439127ff 100644
---
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/client-test.js
+++
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/client-test.js
@@ -72,4 +72,14 @@ describe('Client', function () {
customClient._connection = connectionMock;
customClient.submit(query, null, {'evaluationTimeout': 123,
'materializeProperties': 'tokens'})
});
+
+ it('should use default mimeType', function () {
+ const customClient = new Client('ws://localhost:9321', {traversalSource:
'g', connectOnStartup: false});
+ assert.strictEqual(customClient._connection.mimeType,
'application/vnd.graphbinary-v1.0')
+ });
+
+ it('should use given mimeType', function () {
+ const customClient = new Client('ws://localhost:9321', {traversalSource:
'g', connectOnStartup: false, mimeType: 'application/vnd.gremlin-v2.0+json'});
+ assert.strictEqual(customClient._connection.mimeType,
'application/vnd.gremlin-v2.0+json')
+ });
});