-
Notifications
You must be signed in to change notification settings - Fork 2
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
We should consolidate DB result parsing #228
Comments
On this note -- we can actually use TS generics to signal what type of object is going to be returned by a given I'm inclined to prefer to have type guards since they verify the returned value's type at runtime, but wanted to raise the option in case others felt that was overkill. For instance maybe a better approach would be to protect against malformed queries is to write tests against he query specifically so the tests would fail if they are incorrect. This would potentially allow for edge cases but would result in more succinct code. For what its worth our current type guard actually only exists to validate the response before sending it -- the fact that it happens to be a type guard is really secondary. So I guess this is more a question of: do we want our code to validate that our return value is, in fact, the documented schema before returning it. |
This is part of our effort to update the query logic for our entities via database operation utility functions. This will also pave the way for supporting the new `json` approach to our queries. Issue #228 We should consolidate DB result parsing
This is part of our effort to update the query logic for our entities via database operation utility functions. This will also pave the way for supporting the new `json` approach to our queries. Issue #228 We should consolidate DB result parsing
This is part of our effort to update the query logic for our entities via database operation utility functions. This will also pave the way for supporting the new `json` approach to our queries. Issue #228 We should consolidate DB result parsing
This is part of our effort to update the query logic for our entities via database operation utility functions. This will also pave the way for supporting the new `json` approach to our queries. Issue #228 We should consolidate DB result parsing
This is part of our effort to update the query logic for our entities via database operation utility functions. This will also pave the way for supporting the new `json` approach to our queries. Issue #228 We should consolidate DB result parsing
This is part of our ongoing work of creating type safe utility methods for interacting with the database. Issue #228 We should consolidate DB result parsing
This is part of our ongoing work of creating type safe utility methods for interacting with the database. Issue #228 We should consolidate DB result parsing
This is part of our ongoing work of creating type safe utility methods for interacting with the database. Issue #228 We should consolidate DB result parsing
This continues along our consolidation work for DB interactions. Issue #228 We should consolidate DB result parsing
This continues along our consolidation work for DB interactions. Issue #228 We should consolidate DB result parsing
This modernizes our opportunity db access and also updates the collection endpoint to return a bundle, consistent with other collection endpoints. Issue #228 We should consolidate DB result parsing
This modernizes our opportunity db access and also updates the collection endpoint to return a bundle, consistent with other collection endpoints. Issue #228 We should consolidate DB result parsing
This modernizes our opportunity db access and also updates the collection endpoint to return a bundle, consistent with other collection endpoints. Issue #228 We should consolidate DB result parsing
This modernizes our opportunity db access and also updates the collection endpoint to return a bundle, consistent with other collection endpoints. Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
Issue #228 We should consolidate DB result parsing
This was missed when we did an earlier transition to using centralized DB utilities for organization interactions. Issue #228 We should consolidate DB result parsing
This was missed when we did an earlier transition to using centralized DB utilities for organization interactions. Issue #228 We should consolidate DB result parsing
Right now we in every endpoint we guard against the database response to ensure the database provided a valid type.
As we've implemented more endpoints (and more complex endpoints) we're increasingly duplicating those checks and, more meaningfully, duplicating the need for complicated mocks in our tests.
This came to a head in #210
It would be good to explore creating a centralized helper function that will run a database query and properly parse / handle / throw in the event of an issue. This could hopefully cut down on duplicated test coverage.
The text was updated successfully, but these errors were encountered: