Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Singleton neo4j #79

Merged
merged 13 commits into from
Dec 5, 2020
Merged

Singleton neo4j #79

merged 13 commits into from
Dec 5, 2020

Conversation

okjodom
Copy link

@okjodom okjodom commented Sep 6, 2020

A singleton neo4jService that encapsulates driver. Layers don't need to have a knowledge of underlying neo4j driver. Composition proposed here allows us to smoothly swap out drivers in future #65, and remove driver instantiation on critical boot path #78.
Additionally, this PR formalizes a result API on neo4jService endpoints. Success from service calls return as { status: 200, result: someResult } while failures return { status: 500, error: errorWithStack }

Next: This pattern opens up an opportunity for better error ux, most immediately, a path for solving #77 [ don't rerender if we hit error on create/update new layer ]

PS: Builds on top of changes in PR #75

@okjodom
Copy link
Author

okjodom commented Sep 6, 2020

cc @wagnerjt for reviews on service changes

@okjodom
Copy link
Author

okjodom commented Sep 8, 2020

Not ready until I add tests for the driver... :)

@okjodom okjodom marked this pull request as ready for review September 12, 2020 23:33
@okjodom
Copy link
Author

okjodom commented Sep 12, 2020

Not ready until I add tests for the driver... :)

done. @stellasia, @wagnerjt I'd love your reviews on pr

@okjodom okjodom mentioned this pull request Sep 13, 2020
3 tasks
@okjodom
Copy link
Author

okjodom commented Nov 21, 2020

A singleton neo4jService that encapsulates driver. Layers don't need to have a knowledge of underlying neo4j driver. Composition proposed here allows us to smoothly swap out drivers in future #65, and remove driver instantiation on critical boot path #78.
Additionally, this PR formalizes a result API on neo4jService endpoints. Success from service calls return as { status: 200, result: someResult } while failures return { status: 500, error: errorWithStack }

Next: This pattern opens up an opportunity for better error ux, most immediately, a path for solving #77 [ don't rerender if we hit error on create/update new layer ]

PS: Builds on top of changes in PR #75

@stellasia, let's review and close this PR when possible.

@stellasia
Copy link
Owner

Sure, will do during the coming week!

Copy link
Owner

@stellasia stellasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a couple of other bugs when reviewing but not related to this PR. So looks good to me when the issue with records is fixed (see comment in code)

src/services/neo4jService.js Outdated Show resolved Hide resolved
@okjodom okjodom requested a review from stellasia December 5, 2020 05:15
@stellasia
Copy link
Owner

Thank you very much for this @JoDoM , merging 💯

@stellasia stellasia merged commit 6e88b4f into stellasia:master Dec 5, 2020
@okjodom okjodom deleted the singleton-neo4j branch December 6, 2020 04:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants