Skip to content

element, entry, etc. sub-fields for Link GQL fields#16698

Merged
brandonkelly merged 3 commits into5.7from
feature/link-gql
Feb 14, 2025
Merged

element, entry, etc. sub-fields for Link GQL fields#16698
brandonkelly merged 3 commits into5.7from
feature/link-gql

Conversation

@brandonkelly
Copy link
Copy Markdown
Member

Description

Adds support for accessing linked element data to Link fields over GraphQL.

query{
  entries (section:"news", type:"link") {
    title
    ...on link_Entry {
      linkUrl{
        label
        defaultLabel
        element {
          id
          slug
          uri
          # ...
        }
        entry {
          id
          postDate
          # ...
        }
      }
    }
  }
}

Each selected element type will get an element-type specific field (asset, entry, etc.), and there’s also a generic element field that can be used for generic element data if that’s all you need.

Related issues

@brandonkelly brandonkelly merged commit b810421 into 5.7 Feb 14, 2025
@brandonkelly brandonkelly deleted the feature/link-gql branch February 14, 2025 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant