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(modules-sdk): Parse filters based on loaded modules graph #9158

Merged
merged 15 commits into from
Sep 17, 2024

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Sep 17, 2024

Important

Mikro orm has a bug when applying Filters to relations, it is not correctly propagated (see issue) and the pr that fixes this problem is part of v6 here. So for now it is a known limitation that we currently have. This issue has been discovered as part of that pr but is in fact already existing

What
Parse query filters and assign them correctly.

Along side having the filters of the Query API typed, it is now possible to filter cross modules (graphql like results) using this kind of typed filters

    await query.graph({
          entity: "product",
          fields: ["id", "title", "variants.*", "variants.prices.*"],
          filters: {
            id: "string",
            variants: {
              sku: {
                $eq: "string",
              },
              prices: {
                amount: {
                  $lt: 50,
                },
              },
            },
          }
        },
      )

Copy link

vercel bot commented Sep 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2024 3:57pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Sep 17, 2024 3:57pm
api-reference-v2 ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 3:57pm
docs-ui ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 3:57pm
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 3:57pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 3:57pm
resources-docs ⬜️ Ignored (Inspect) Visit Preview Sep 17, 2024 3:57pm

Copy link

changeset-bot bot commented Sep 17, 2024

⚠️ No Changeset found

Latest commit: 9238d8c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@adrien2p adrien2p marked this pull request as ready for review September 17, 2024 16:06
@adrien2p adrien2p requested a review from a team as a code owner September 17, 2024 16:06
@carlos-r-l-rodrigues carlos-r-l-rodrigues changed the title feat(modules-sdk): Parse filters and identify correct colocation feat(modules-sdk): Parse filters based on loaded modules graph Sep 17, 2024
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.

Nice work! 🔥

Lots of stuff going on – think the easiest way to review it is to put it to use. With that in mind, I think we should merge it and get people to start playing around with it.

@carlos-r-l-rodrigues carlos-r-l-rodrigues merged commit c6795df into develop Sep 17, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants