Skip to content

feat: expose whole course metadata response in react query cache#249

Closed
diana-villalvazo-wgu wants to merge 1 commit intoopenedx:mainfrom
WGU-Open-edX:expose-course-metadata
Closed

feat: expose whole course metadata response in react query cache#249
diana-villalvazo-wgu wants to merge 1 commit intoopenedx:mainfrom
WGU-Open-edX:expose-course-metadata

Conversation

@diana-villalvazo-wgu
Copy link
Copy Markdown
Contributor

As part of the work done on Instructor Dashboard, some attributes from the course metadata request can be useful, so instead of doing the call again we can access to react query keys and get the info from the cache, in the current implementation only the tabs were returned from that api call, so i added all the attributes from the request so it can be used on any repo if they call the query key data.

Usage Example: openedx/frontend-app-instructor-dashboard#189

Data on React Query

Before
Screenshot 2026-04-27 at 10 38 17 p m

After
Screenshot 2026-04-27 at 10 37 22 p m

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Apr 28, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @diana-villalvazo-wgu!

This repository is currently maintained by @openedx/axim-engineering.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Apr 28, 2026
@diana-villalvazo-wgu diana-villalvazo-wgu moved this from Needs Triage to Ready for Review in Contributions Apr 28, 2026
Copy link
Copy Markdown
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

I understand that we want to minimize hitting the server, but I don't think this is a good pattern. In particular, I see three issues:

  1. Coupling frontend-app-instructor-dashboard with a header implementation detail is a bad idea: what if we change the key or the query in the header? It's not a public API.

  2. I don't believe this is how React Query is meant to be used. The whole point is you query for what you need, and let it worry about de-duplicating things. What you can be smart about, though, is taking advantage of it - maybe by making sure that what you're querying matches what's being queried elsewhere, so React Query can do its deduplication. In other words, let both the header and instructor-dash hit the same endpoint with duplicate queries, then let React Query deduplicate them.

  3. any is bad. Only use it if there's no other choice - even unknown is better, if possible. But in this case, for a well formatted API response, there is really no reason not to type it properly.

@diana-villalvazo-wgu
Copy link
Copy Markdown
Contributor Author

We will handle it from instructor dash as a diff query key

@diana-villalvazo-wgu diana-villalvazo-wgu deleted the expose-course-metadata branch April 28, 2026 16:04
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Apr 28, 2026
@arbrandes arbrandes mentioned this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants