Skip to content

GraphQL drops custom navigation item fields for “link to entry” nodes #12719

@sjoerdoudman

Description

@sjoerdoudman

Bug description

Statamic’s data model and its GraphQL implementation are out of sync.

The CMS UI suggests parity

When you add custom fields (e.g. icon, description) to a navigation blueprint, you see and can edit them for all nav items — both “manual” and “link to entry”.

That gives a clear UX promise: “these fields belong to the nav item itself.”
The data actually exists in storage

The YAML under /content/trees/navigation/... does contain the custom data for linked entries. So the backend knows about it and persists it properly.

GraphQL drops that data without warning
The GraphQL schema swaps an entry reference for the entry model, losing all nav-level metadata.

There’s no configuration, no warning, no way to recover it through normal means. This breaks the headless assumption The whole point of Statamic’s GraphQL API is to make the CMS data available to frontend frameworks.

Yet a core CMS concept — navigation items with per-item metadata — is incomplete.

How to reproduce

  1. Create a new navigation menu called 'Example menu' and edit the menu blueprint.
  2. Add fields like 'icon', 'description' or 'style' .
  3. In the menu configuration add any collection at 'collections'.
  4. Create menu items in your menu. Create some 'Nav items' and some 'Links to Entry'
  5. Open the graphql visualiser. And select 'nav' plus the appropriate fields under 'NavBasicPage_exampleMenu'
  6. Run the query. You will see the 'Nav items' will have the additional fields. Your 'links to entry' will have only the entry data, not the additional fields created in the blueprint

Logs

Example menu yaml:
title: 'Example menu'
collections:
  - pages
tabs:
  main:
    display: Main
    sections:
      -
        fields:
          -
            handle: description
            field:
              type: textarea
              display: Description
              localizable: false
          -
            handle: icon
            field:
              type: text
              display: Icon
              localizable: false

Environment

Environment
Application Name: Statamic
Laravel Version: 11.41.0
PHP Version: 8.3.19
Composer Version: 2.8.9
Environment: local
Debug Mode: ENABLED
URL: travel-essence.ddev.site
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: log
Queue: sync
Session: file

Locales
Installed: en
LaravelLang\Lang\Plugin: 15.21.0
Locales Version: 2.10.0
Protected: en
Publisher Version: 16.6.0

Statamic
Addons: 3
Sites: 4 (Travel Essence - Nederlands, Travel Essence - English, Great Outdoors - Nederlands, Great Outdoors - English)
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.65.1 PRO

Statamic Addons
daun/statamic-graphql-alternate-locales: 1.0.0
statamic-rad-pack/runway: 8.5.0
statamic/eloquent-driver: 4.23.2

Statamic Eloquent Driver
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: file
Entries: eloquent
Forms: file
Global Sets: file
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: file
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: eloquent

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions