Skip to content
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

feat(medusa-js, medusa-react): Support expand fields in order retrieval #2353

Merged
merged 3 commits into from
Oct 6, 2022

Conversation

pKorsholm
Copy link
Contributor

@pKorsholm pKorsholm commented Oct 5, 2022

What

  • Add query parameter to medusa-js and medusa-react to support selecting fields and relations when querying orders using the retrieve endpoint
  • Add new querykey for order retrieval

Why

  • fix(medusa): order retrieval missing relations + allow for expand #2267 added this capability in the API, so we should expand it to the clients
  • in order to use custom queries when retrieving orders in the admin (necessary change due to edits not being a default relation)
  • update query keys: to support refetching an order with different expand and field params
    • otherwise subsequent retrievals would be cache-hits against an order that was retrieved with different parameters causing missing or abundant fields

@pKorsholm pKorsholm requested a review from a team as a code owner October 5, 2022 07:23
@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2022

🦋 Changeset detected

Latest commit: 0ddb47c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@medusajs/medusa-js Patch
medusa-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM!

@olivermrbl olivermrbl changed the title Feat(medusa-js, medusa-react): add expand fields to get order feat(medusa-js, medusa-react): add expand fields to get order Oct 6, 2022
@olivermrbl olivermrbl changed the title feat(medusa-js, medusa-react): add expand fields to get order feat(medusa-js, medusa-react): Support expand fields in order retrieval Oct 6, 2022
@olivermrbl olivermrbl merged commit 642902a into develop Oct 6, 2022
@olivermrbl olivermrbl deleted the feat/add-expand-fields-to-get-order branch October 6, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants