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

fix: deep querying, handle getLocalizedPaths for blocks #10187

Merged
merged 3 commits into from
Dec 27, 2024

Conversation

r1tsuu
Copy link
Member

@r1tsuu r1tsuu commented Dec 26, 2024

Fixes #10126

Properly handles the getLocalizedPaths function for blocks.

Previously, using collection with this config:

{
  slug: 'deep-nested',
  fields: [
    {
      type: 'tabs',
      tabs: [
        {
          name: 'content',
          fields: [
            {
              type: 'blocks',
              name: 'blocks',
              blocks: [
                {
                  slug: 'testBlock',
                  fields: [
                    {
                      type: 'tabs',
                      tabs: [
                        {
                          name: 'meta',
                          fields: [
                            {
                              type: 'relationship',
                              relationTo: 'movies',
                              name: 'movie',
                            },
                          ],
                        },
                      ],
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
    },
  ],
},

The following query didn't work in MongoDB:

const result = await payload.find({
  collection: 'deep-nested',
  where: {
    'content.blocks.meta.movie': {
      equals: movie.id,
    },
  },
})

@DanRibbens DanRibbens merged commit eff75f9 into main Dec 27, 2024
66 checks passed
@DanRibbens DanRibbens deleted the fix/nested-querying branch December 27, 2024 14:46
Copy link
Contributor

🚀 This is included in version v3.12.0

@LouisCuvelier
Copy link

Thanks guys !

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.

Query relationship in nested Tabs > Blocks > Tabs > Relationship is not working
3 participants