Skip to content

Conversation

@exacs
Copy link
Contributor

@exacs exacs commented Oct 27, 2025

This PR:

  • Splits and simplifies the function getLinksByPath into two: getPath and getItems
  • Changes the return object to allow future extensions (before it was only the metadata, now is an object containing the metadata)
  • Adds a locale option in both, especially useful when making breadcrumbs.
  • Updates the test page

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the getLinksByPath method by splitting it into two specialized methods: getPath for retrieving ancestor pages (breadcrumbs) and getItems for retrieving child pages. The changes improve API clarity and add locale support for internationalization.

Key changes:

  • Split getLinksByPath into getPath and getItems methods with clearer purposes
  • Changed return format from bare metadata to objects containing metadata, enabling future extensibility
  • Added locale filtering capability via new locales option in GraphGetLinksOptions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/optimizely-cms-sdk/src/index.ts Exports new GraphGetLinksOptions type
packages/optimizely-cms-sdk/src/graph/index.ts Implements getPath and getItems methods, adds dedicated GraphQL queries, updates type definitions
packages/optimizely-cms-sdk/src/graph/filters.ts Adds localeFilter function and extends ContentInput type
test/test-website/src/app/related/[...slug]/page.tsx Updates usage to new API methods and adjusts data access patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@exacs exacs merged commit fe1dc4d into main Oct 28, 2025
3 checks passed
@exacs exacs deleted the feature/CMS-46146-split-methods branch October 28, 2025 13:49
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.

3 participants