-
Notifications
You must be signed in to change notification settings - Fork 2
Split getLinksByPath into two methods
#147
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
Conversation
There was a problem hiding this 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
getLinksByPathintogetPathandgetItemsmethods with clearer purposes - Changed return format from bare metadata to objects containing metadata, enabling future extensibility
- Added locale filtering capability via new
localesoption inGraphGetLinksOptions
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>
This PR:
getLinksByPathinto two:getPathandgetItemslocaleoption in both, especially useful when making breadcrumbs.