feat(navigation): add featuredLinksSet and orderedSetID; add orderedSetID to createFeaturedLink#7499
Conversation
…etID to createFeaturedLink - NavigationVersion: featuredLinksSet, orderedSetID - createFeaturedLink: optional orderedSetID to add new link to an ordered set
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
| if (args.orderedSetID) { | ||
| if (!addSetItemLoader) { | ||
| throw new Error("addSetItemLoader is not defined") | ||
| } | ||
|
|
||
| await addSetItemLoader(args.orderedSetID, { | ||
| item_id: featuredLink.id, | ||
| }) | ||
| } |
There was a problem hiding this comment.
🟡 Non-atomic two-step operation: If addSetItemLoader fails after the featured link is already created, the featured link will exist as an orphan (created but not added to the ordered set). The catch block will format this as a GravityMutationError or re-throw, making it look like the entire operation failed — but the link was actually created.
This may be acceptable given the architecture, but worth considering whether the caller needs to know about this partial-failure state (e.g., returning the created link's ID even on set-addition failure so it can be cleaned up or retried).
Code ReviewSummaryThis PR adds support for associating featured links with ordered sets via a new Issues Found
Areas Reviewed
Overall this is a clean, well-structured PR. The non-atomic mutation concern is the only notable item, and it may be acceptable given the system's architecture. 🤖 Generated with Claude Code |
| ...InternalIDFields, | ||
| createdAt: date(({ created_at }) => created_at, true), | ||
| featuredLinksSet: { | ||
| type: new GraphQLList(FeaturedLinkType), |
There was a problem hiding this comment.
I missed this earlier but we should be able to make this a non-nullable list with non-nullable FeaturedLinkType entries.
That should reduce the amount of null checks needed in Force.
There was a problem hiding this comment.
suggestion: Also: since we're no longer returning a Set type here - should we drop the Set suffix? Maybe just featuredLinks?
Adds support for managing navigation visual components from Forque.
NavigationVersion:
Example:
{ navigationVersion(groupID: "whats-new") { featuredLinksSet { title subtitle image { url } } } }Response:
CreateFeaturedLink mutation: