Skip to content

How to filter records based on remote link using remote query in Medusa 2.0? #8369

Closed Answered by vholik
vholik asked this question in Q&A
Discussion options

You must be logged in to vote

@carlos-r-l-rodrigues of Medusa core team replied me on a Discord channel with this information:

Cross module filtering/sorting is not yet supported in the 2.0 preview release.
It will be available soon as a new module that you will be able to do it.

At the moment, as an alternative, you can query from your link filtering it by vendor_id and expanding products.
something like this:

const yourLink = yourDefineLinkReturn // import the reference of your defineLink here
const query = remoteQueryObjectFromString({
    service: yourLink.serviceName,
    fields: ["vendor.*", "product.*"],
    variables: {
      filters: {
          vendor_id: [vendorAdmin.vendor.id]
      },
      take: 15

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vholik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant