FlorianHockmann commented on code in PR #2599:
URL: https://github.com/apache/tinkerpop/pull/2599#discussion_r1636325328


##########
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/graph.ts:
##########
@@ -43,27 +42,32 @@ export class Graph {
   }
 }
 
-class Element {
+class Element<TLabel extends string = string, TId = any> {
   constructor(
-    readonly id: string,
-    readonly label: string,
+    readonly id: TId,
+    readonly label: TLabel,

Review Comment:
   I see, so users who don't define their own types (like `Person`) will simply 
have a `Vertex` where `label` is a `string`, but users can restrict the `label` 
to their own allowed set of label if they want to.
   Thanks for the explanation! I'm marking this as resolved now. @joshsh feel 
free to unresolve if you more questions about this.



-- 
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]

Reply via email to