-
Notifications
You must be signed in to change notification settings - Fork 151
GQL errors and update to bolt protocol #1225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 28 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
65b8ab0
First draft of gql error implementation
MaxAake ba9b85b
deno build
MaxAake f4cfeb2
Merge 5.0 into gql-errors
MaxAake 8bec197
Updates to support upcoming bolt version 5.7
MaxAake a0833c5
disable bolt 5.7 testkit feature
MaxAake 8dcb0e0
bolt 5.7 and connection to testkit
MaxAake b6c0dd9
Update testkit.json
MaxAake 9e36084
Update of diagnostic record and bump to latest testkit
MaxAake 2b13e3b
handle rename of code to neo4j_code in 5.7
MaxAake bd3bb56
expanded support for bolt 5x7
MaxAake a65e3e5
change order of newError arguments to not conflict with older code
MaxAake 887f031
switch to latest testkit commit and fix deno backend
MaxAake a6f132c
Update controller.ts
MaxAake a17c825
prettified deno code and expanded testkit logging
MaxAake 6abc197
update to conform to ADR
MaxAake e257ea4
additional testkit logging
MaxAake 5e18917
fix silly mistake
MaxAake e11cb49
small cause update
MaxAake 6324dce
learn to recognize bolt 5.7 and remove some logging
MaxAake b902f31
corrected error sending in deno testkit
MaxAake 09f7cda
Cypher type bindings for deno
MaxAake 963bec9
Documentation and integration test fix
MaxAake 2bbc3e4
add documentation to deno error class
MaxAake bc0d95c
Update response-handler.test.js
MaxAake 8ca335e
Update response-handler.test.js
MaxAake 2992eff
remove code from cause in test
MaxAake 99761be
updated documentation for error
MaxAake 86a4d80
very important deno build
MaxAake 9dfa3e6
Update packages/bolt-connection/src/bolt/bolt-protocol-v5x6.js
MaxAake bb31dcd
addressing comments from code review
MaxAake 54df47b
cleanup
MaxAake 780dcef
small error
MaxAake 4cdddde
connection channel integration test correction
MaxAake 5b67b67
Update testkit.json
MaxAake 1dfa32c
minor test change and marking changes as preview
MaxAake File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ coverage | |
*.code-workspace | ||
/testkit/CAs | ||
/testkit/CustomCAs | ||
/testkit/firefox_profile/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Copyright (c) "Neo4j" | ||
* Neo4j Sweden AB [https://neo4j.com] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import BoltProtocolV5x6 from './bolt-protocol-v5x6' | ||
|
||
import transformersFactories from './bolt-protocol-v5x5.transformer' | ||
import Transformer from './transformer' | ||
|
||
import { internal } from 'neo4j-driver-core' | ||
|
||
const { | ||
constants: { BOLT_PROTOCOL_V5_7 } | ||
} = internal | ||
|
||
const DEFAULT_DIAGNOSTIC_RECORD = Object.freeze({ | ||
OPERATION: '', | ||
OPERATION_CODE: '0', | ||
CURRENT_SCHEMA: '/' | ||
}) | ||
|
||
export default class BoltProtocol extends BoltProtocolV5x6 { | ||
get version () { | ||
return BOLT_PROTOCOL_V5_7 | ||
} | ||
|
||
get transformer () { | ||
if (this._transformer === undefined) { | ||
this._transformer = new Transformer(Object.values(transformersFactories).map(create => create(this._config, this._log))) | ||
} | ||
return this._transformer | ||
} | ||
|
||
/** | ||
* | ||
* @param {object} metadata | ||
* @returns {object} | ||
*/ | ||
enrichErrorMetadata (metadata) { | ||
return { | ||
...metadata, | ||
cause: (metadata.cause !== null && metadata.cause !== undefined) ? this.enrichErrorMetadata(metadata.cause) : null, | ||
code: metadata.neo4j_code, | ||
diagnostic_record: metadata.diagnostic_record !== null ? { ...DEFAULT_DIAGNOSTIC_RECORD, ...metadata.diagnostic_record } : null | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/bolt-connection/src/bolt/bolt-protocol-v5x7.transformer.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Copyright (c) "Neo4j" | ||
* Neo4j Sweden AB [https://neo4j.com] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import v5x6 from './bolt-protocol-v5x6.transformer' | ||
|
||
export default { | ||
...v5x6 | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.