-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding initialization work to display conditions.category and build queries #103
Adding initialization work to display conditions.category and build queries #103
Conversation
…mation-to-the-frontend
…mation-to-the-frontend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Think an API endpoint would be good. Could see a world where someone might query that in a script they're developing against our API, in which case having it accessible would be helpful. Could always remove it if we don't end up needing it
I might be missing some of the context here but an API call seems like overkill at this point. The goal is just to get the conditions that currently exist in the database and display them to users in two different ways, right? Even if we add an API, we'll still be making a database call to complete the request so I'd just go with the DB call for now. Something else that comes to mind (and you probably have already thought of it) but as we move forward to actually rendering the conditions on the page you describe, we should thinking carefully about how often the db call is made. That is, can we smartly cache/store the results so it's not making the call each time the page loads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪
the main issue I'm reading up on is whether it starts to approach having your frontend making queries/updates to the database is generally frowned upon and that to build the queries, we're gonna have users doing lots of transactions where APIs give us a little more protection. https://www.angularminds.com/blog/why-you-need-an-api-layer-and-how-to-build-it-in-react I tend to agree though that I think it would be easier to do a generic |
…mation-to-the-frontend
Will weigh in that this is a little bit different in Next.js land where the whole point of the framework is to allow for server-side code to be easily integrated into our frontend logic within the same programming paradigm. In some cases, (including this one depending on how we handle the caching concerns Marcelle is making) there would actually be optimizations calling the code through server actions rather than through the API. See this writeup for a succinct example and this reddit thread if you want to wade into the internet debate Think we should ask the question of whether we want an API endpoint from a product / feature perspective (ie is it useful for our users or us in the future for building things out) rather than a technical concerns perspective. The earlier opinion I offered for the API option obviously comes out in one direction, but don't hold that too strongly since thing this would be a fringe endpoint either way. |
…mation-to-the-frontend
intending to merge now but raise in 11/4 parking lot this question of implementing the API since we still need the |
PULL REQUEST
Summary
Adds an API that pulls the condition data.
I think we need conditions.ts for two purposes in the workflow:
conditions.name
grouped byconditions.category
on this page: https://www.figma.com/design/Iuw9me6kYftBF4WTCEsCZz/Query-Connector?node-id=475-18708&node-type=frame&t=QNaDph9YAIwc5BOa-0condition.id
(s) on that page to query for ValueSets to display when advancing to the next page. Should be able to use a loop of existing code indatabase-service.ts
in order pull valuesets and concepts.I think the main open question is whether we want to use API calls or continue to use database calls. I keep reading arguments for both. I think I lean toward actually just wanting to add a database query that pulls conditions data directly to avoid adding an additional API layer, but I am not sure if we should take this step to initialize an API. Curious others' thoughts.
Related Issue
Fixes https://linear.app/skylight-cdc/issue/QUE-26/expose-category-information-to-the-frontend
Acceptance Criteria
Please copy the acceptance criteria from your ticket and paste it here for your reviewer(s)
For frontend PR’s - include a description (including anything that’s out of scope) for what you want the designers to review
Additional Information
Anything else the review team should know?
Checklist