Skip to content

Conversation

@exacs
Copy link
Contributor

@exacs exacs commented Nov 7, 2025

This PR adds all non-user defined fields (like _metadata) to the response when calling the function getContentByPath. It also completes the non-scalar values (like URL)

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 GraphQL fragment generation to use common base fragments for all content types, expanding metadata and URL fields. The changes unify the fragment handling approach instead of treating media types as a special case.

  • Replaced media-specific fragment logic with universal base type fragments that apply to all content types
  • Expanded InferredUrl and InferredBase types to include additional metadata fields
  • Updated URL, link, and contentReference property handling to use fragment spreading

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
baseTypeUtil.ts Refactored to provide common fragments for all base types instead of media-specific ones
infer.ts Added comprehensive metadata fields and expanded URL structure to match GraphQL schema
createQuery.ts Updated to use ContentUrl fragment for URL types and apply base fragments universally
createQueryExperiences.test.ts Updated test expectations to reflect new common fragments in all generated queries
createQuery.test.ts Updated all test snapshots to include new base fragments and ContentUrl fragment usage
convertProperty.test.ts Adjusted fragment count threshold from 101 to 105 to account for additional common fragments

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

@exacs exacs had a problem deploying to Vercel preview environment November 7, 2025 13:53 — with GitHub Actions Failure
@exacs exacs merged commit 501fce3 into main Nov 10, 2025
4 checks passed
@exacs exacs deleted the feature/CMS-46656-all-fields branch November 10, 2025 09:41
@exacs exacs restored the feature/CMS-46656-all-fields branch November 10, 2025 09:43
@exacs exacs deleted the feature/CMS-46656-all-fields branch November 10, 2025 09:43
_modified: string;
_score: number;
_id: string;
_track: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not so sure about the fields above _metadata. Some of them might make sense when we implement free text search in the SDK. For example, _fulltext can return a lot of data and this data only makes sense when you do a free text search. This field is an aggregation of all searchable properties, which can be a lot.

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.

4 participants