CARVIEW |
Select Language
HTTP/2 200
date: Tue, 22 Jul 2025 20:20:03 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/neo4j/neo4j-javascript-driver.git
etag: W/"84391bf5596ebf5ac525f2343f09757f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=v50qlm%2BqKkapByYOUHLJnZz11%2BPJwk%2BWtVig%2Fl0lOV7twaDFx6Cbp%2FciU6Wj3gJk7im7wwWcO7rqedihE7RaIT0R2GOceKjGI0c%2F3v%2F6QXPl8%2B9KMCttHIVSJbhbpAYwCmL0j7R3z51nrqEJOpEKBK7q%2BfwqVDrpcRnskmfzIRfIlBYme5iLDexQaBUv3aj%2BVxnNt5PMTEtpwACITM0mPfkhXIIXGLEyI7UCdPYmXdraM4nOZxFKUrDFaVq8jQrbx%2Bk5SI0p5sFPsosqJ7dz0w%3D%3D--W4Fbcr4SOm2NCRa7--rBSvfkpjQ%2FYd8BDQshLFxQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1983402718.1753215602; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 20:20:02 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 20:20:02 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E950:26221E:FFFEC:147636:687FF272
Add generic types for Node#labels, Relationship#type and UnboundRelat… · neo4j/neo4j-javascript-driver@85c0939 · GitHub
⚠️ This type definitions are not asserted in runtime. Thus mismatched type records coming from the database will not trigger type errors.
Copy file name to clipboardExpand all lines: packages/core/src/graph-types.ts
Copy file name to clipboardExpand all lines: packages/core/test/graph-types.test.ts
Copy file name to clipboardExpand all lines: packages/neo4j-driver-deno/lib/core/graph-types.ts
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit 85c0939
authored
Add generic types for Node#labels, Relationship#type and UnboundRelationship#type (#1014)
This generic types enable defining a list string like values accepted for an specific node labels list or relationship type.
Node example:
```typescript
type PersonLabels = 'Person' | 'Actor'
// get the person from a non-typed record. If the record is correctly type-mapped
// the Node type can be omitted since it will be inferred.
const person: Node<Integer, PersonProps, PersonLabels> = record.get('person')
// get labels
// the type inferred for the labels will be PersonLabels[]
const labels = person.labels
// @ts-exepct-error
const wrongLabels: 'Car'|'Bicycle'[] = person.labels
```
Relationship/UnboundRelationship example:
```typescript
type ActedInType = 'ACTED_IN'
// get the relationship from a non-typed record. If the record is correctly type mapped
// the Relationship type can be omitted since it will be inferred.
const actedIn: Relationship<Integer, ActedInProps, ActedInType> = record.get('actedIn')
// get type
// the type inferred for the relType will be 'ACTED_IN'
const relType = actedIn.type
// @ts-expect-error
const directed: 'DIRECTED' = actedIn.type
```
1 parent 1720c97 commit 85c0939Copy full SHA for 85c0939
File tree
Expand file treeCollapse file tree
3 files changed
+58
-18
lines changedFilter options
- packages
- core
- src
- test
- neo4j-driver-deno/lib/core
Expand file treeCollapse file tree
3 files changed
+58
-18
lines changedpackages/core/src/graph-types.ts
Copy file name to clipboardExpand all lines: packages/core/src/graph-types.ts+9-9Lines changed: 9 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
| 50 | + | |
51 | 51 |
| |
52 |
| - | |
| 52 | + | |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
63 |
| - | |
| 63 | + | |
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
127 |
| - | |
| 127 | + | |
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
131 |
| - | |
| 131 | + | |
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
| |||
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
| |
150 |
| - | |
| 150 | + | |
151 | 151 |
| |
152 | 152 |
| |
153 | 153 |
| |
| |||
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
239 |
| - | |
| 239 | + | |
240 | 240 |
| |
241 |
| - | |
| 241 | + | |
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
| |||
250 | 250 |
| |
251 | 251 |
| |
252 | 252 |
| |
253 |
| - | |
| 253 | + | |
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
|
packages/core/test/graph-types.test.ts
Copy file name to clipboardExpand all lines: packages/core/test/graph-types.test.ts+40Lines changed: 40 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
81 | 97 |
| |
82 | 98 |
| |
83 | 99 |
| |
| |||
191 | 207 |
| |
192 | 208 |
| |
193 | 209 |
| |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
194 | 222 |
| |
195 | 223 |
| |
196 | 224 |
| |
| |||
306 | 334 |
| |
307 | 335 |
| |
308 | 336 |
| |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
309 | 349 |
| |
310 | 350 |
| |
311 | 351 |
| |
|
packages/neo4j-driver-deno/lib/core/graph-types.ts
Copy file name to clipboardExpand all lines: packages/neo4j-driver-deno/lib/core/graph-types.ts+9-9Lines changed: 9 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
| 50 | + | |
51 | 51 |
| |
52 |
| - | |
| 52 | + | |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
63 |
| - | |
| 63 | + | |
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
127 |
| - | |
| 127 | + | |
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
131 |
| - | |
| 131 | + | |
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
| |||
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
| |
150 |
| - | |
| 150 | + | |
151 | 151 |
| |
152 | 152 |
| |
153 | 153 |
| |
| |||
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
239 |
| - | |
| 239 | + | |
240 | 240 |
| |
241 |
| - | |
| 241 | + | |
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
| |||
250 | 250 |
| |
251 | 251 |
| |
252 | 252 |
| |
253 |
| - | |
| 253 | + | |
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
|
You can’t perform that action at this time.
0 commit comments