Skip to content
Discussion options

You must be logged in to vote

The performance issue you're hitting is a known pain point with deeply nested arrays/blocks in Payload 3.x — it's not specific to SQLite, though SQLite makes it worse because of how Payload generates the join queries for nested structures.

Here's the pattern I'd recommend for a mega menu:

Use a separate collection instead of nesting everything in a Global.

Create a menu-items collection with a self-referencing relationship for hierarchy:

const MenuItems: CollectionConfig = {
  slug: 'menu-items',
  admin: {
    useAsTitle: 'label',
  },
  fields: [
    {
      name: 'label',
      type: 'text',
      required: true,
    },
    {
      name: 'link',
      type: 'text',
    },
    {
      name

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jacksoggetto
Comment options

Answer selected by jacksoggetto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants