Cole-Greer commented on code in PR #3330:
URL: https://github.com/apache/tinkerpop/pull/3330#discussion_r2962877462
##########
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts:
##########
@@ -110,31 +104,29 @@ export default class Client {
* @param {Object|null} [bindings] The script bindings, if any.
* @param {RequestOptions} [requestOptions] Configuration specific to the
current request.
* @returns {Promise}
- */
+ */ //TODO:: tighten return type to Promise<ResultSet>
submit(message: string, bindings: any | null, requestOptions?:
RequestOptions): Promise<any> {
- const requestIdOverride = requestOptions && requestOptions.requestId;
- if (requestIdOverride) {
- delete requestOptions['requestId'];
- }
-
- const args = Object.assign(
- {
- gremlin: message,
- aliases: { g: this.options.traversalSource || 'g' },
- },
- requestOptions,
- );
-
- args['language'] = 'gremlin-lang';
- args['accept'] = this._connection.mimeType;
-
- if (bindings) args['bindings'] = bindings;
-
- if (this.options.session && this.options.processor === 'session') {
- args['session'] = this.options.session;
- return this._connection.submit('session', 'eval', args,
requestIdOverride);
- }
- return this._connection.submit(this.options.processor || '', 'eval', args,
requestIdOverride);
+ const requestBuilder = RequestMessage.build(message)
+ .addG(this.options.traversalSource || 'g')
Review Comment:
I've migrated that to `request-message`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]