Skip to content

feat(highlights): add channelDigests query#3932

Merged
idoshamun merged 4 commits into
mainfrom
eng-1633-new-gql-query-for-receiving-all-the-channel-digests
Jun 8, 2026
Merged

feat(highlights): add channelDigests query#3932
idoshamun merged 4 commits into
mainfrom
eng-1633-new-gql-query-for-receiving-all-the-channel-digests

Conversation

@idoshamun
Copy link
Copy Markdown
Member

What

Adds a top-level read-only channelDigests GraphQL query that returns all enabled channel digests, resolved through GraphORM on the read replica and ordered by channel ASC, key ASC.

Changes

  • src/schema/highlights.ts — New ChannelDigest GraphQL type (key, channel, frequency, enabled, resolved source) and the channelDigests: [ChannelDigest!]! query. Resolver mirrors the existing channelConfigurations style and filters to enabled = true at the DB level.
  • src/graphorm/index.ts — Added a ChannelDigest GraphORM mapping. Extracted the shared source custom relation into a channelDigestSourceField constant reused by both ChannelDigest and the existing ChannelDigestConfiguration mappings to avoid duplication.
  • __tests__/highlights.ts — Integration tests covering ordering across channels, resolved source, disabled-digest exclusion, and the empty-result case.

Key decisions

  • Dedicated ChannelDigest type rather than reusing ChannelDigestConfiguration (which lacks channel/key and is shaped as a nested config sub-object).
  • Minimal field set — excludes internal tuning fields (minHighlightScore, sentimentGroupIds, includeSentiment, targetAudience); these can be added later without a breaking change.
  • Public, enabled-only, no args — matches channelConfigurations (no @auth). An includeDisabled arg can be added later if a client needs it.
  • No DB migration, entity, or worker changes — purely additive GraphQL read.

Closes ENG-1633


Created by Huginn 🐦‍⬛

idoshamun and others added 2 commits June 8, 2026 06:17
Add a top-level read-only `channelDigests` query that returns all enabled
channel digests, resolved through GraphORM on the read replica and ordered
by channel then key. Introduce a dedicated `ChannelDigest` GraphQL type
exposing key, channel, frequency, enabled and the resolved source, with a
matching GraphORM mapping reusing the existing source custom relation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address self-review: extract the shared `source` customRelation into a
`channelDigestSourceField` constant reused by both the ChannelDigest and
ChannelDigestConfiguration GraphORM mappings instead of duplicating it.
Merge the overlapping channelDigests ordering and disabled-exclusion
tests into a single scenario.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pulumi
Copy link
Copy Markdown

pulumi Bot commented Jun 8, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at 858b298) was successful.

✨ Neo Code Review

Routine deployment of a new GraphQL query (`channelDigestConfigurations`) with a full image rollout and standard migration job rotation. ✅ Low Risk — confirm the underlying `ChannelDigest` table/entity is already present or a migration is included.

This is a routine application deployment rolling out commit feae556d (previously 8c1734aa). The PR adds a new channelDigestConfigurations GraphQL query that returns enabled ChannelDigest records ordered by channel and key, along with associated tests and AGENTS.md documentation guidance.

All deployment and cron job updates are purely image tag bumps to the new commit SHA. The migration jobs (both DB and Clickhouse) are replaced by new ones named with the new commit hash — this is the standard pattern for one-shot migration Jobs in this stack.

🔵 Info — The new vpc-native-api-db-migration-feae556d Job will run TypeORM migrations on deploy. The PR diff doesn't show migration files, so verify that the ChannelDigest entity and GQLChannelDigestConfiguration type already exist in the schema/database before merge, or that a migration is bundled in this commit.

Resource Changes

    Name                                                       Type                           Operation
+   vpc-native-api-clickhouse-migration-feae556d               kubernetes:batch/v1:Job        create
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-channel-highlights-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-expire-super-agent-trial-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-digests-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tags-str-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-worker-job-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
~   vpc-native-materialize-yearly-best-post-archives-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-weekly-quests-cron                       kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-update-views-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-expired-better-auth-sessions-cron         kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-highlights-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob    update
-   vpc-native-api-clickhouse-migration-8c1734aa               kubernetes:batch/v1:Job        delete
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment  update
... and 13 other changes

Comment thread src/graphorm/index.ts Outdated
source: channelDigestSourceField,
},
},
ChannelDigest: {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why do we need both ChannelDigestConfiguration and ChannelDigest? Seems like duplicates. We can just reuse the existing one

…nnelDigest

Address review: ChannelDigestConfiguration and ChannelDigest were two
GraphQL types both mapped from the ChannelDigest entity with an identical
source relation. Drop ChannelDigestConfiguration, reuse the entity-aligned
ChannelDigest type for the nested channelConfigurations.digest field, and
inline the now single-use source relation. Document the one-type-per-entity
guidance in AGENTS.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@idoshamun
Copy link
Copy Markdown
Member Author

Good catch — they were indeed duplicates, both mapped from: 'ChannelDigest'. Consolidated into the single entity-aligned ChannelDigest type and pointed channelConfigurations.digest at it, dropping ChannelDigestConfiguration entirely (1fd09b4).

Per review direction: leave existing types and names untouched. Revert the
introduced ChannelDigest type/mapping and instead expose the new top-level
query as channelDigestConfigurations returning the existing
ChannelDigestConfiguration type, ordered by channel then key and filtered
to enabled digests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@idoshamun
Copy link
Copy Markdown
Member Author

Update: rather than renaming the existing type, kept ChannelDigestConfiguration (and all existing names) exactly as-is and exposed the new query as channelDigestConfigurations: [ChannelDigestConfiguration!]!, reusing that type. src/graphorm/index.ts is now unchanged from base — the diff is purely the additive query + resolver + tests (858b298).

@idoshamun idoshamun merged commit 8766c77 into main Jun 8, 2026
7 of 9 checks passed
@idoshamun idoshamun deleted the eng-1633-new-gql-query-for-receiving-all-the-channel-digests branch June 8, 2026 07:52
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