Skip to content

refactor: streamline GraphQL schema by removing deprecated fields and…#8915

Merged
mikeallisonJS merged 6 commits intomainfrom
00-00-MA-chore-modern-override-cleanup
Apr 7, 2026
Merged

refactor: streamline GraphQL schema by removing deprecated fields and…#8915
mikeallisonJS merged 6 commits intomainfrom
00-00-MA-chore-modern-override-cleanup

Conversation

@mikeallisonJS
Copy link
Copy Markdown
Collaborator

@mikeallisonJS mikeallisonJS commented Mar 26, 2026

… updating input types

  • Removed cardBlockCreate and cardBlockUpdate mutations from api-journeys schema.
  • Updated adminJourney query to align with modern API structure.
  • Refactored DateTimeFilter input type for better clarity and usage.
  • Adjusted various GraphQL types to ensure consistency across schemas.
  • Cleaned up unused imports and types in resolver files to enhance maintainability.

Summary by CodeRabbit

Release Notes

  • Removed Features

    • Removed icon block creation capability from the API.
    • Removed admin journey query endpoint.
  • API Reorganization

    • Migrated card block update functionality between services.
    • Reorganized button block and journey profile management operations for improved architecture.
    • Streamlined GraphQL operation routing across federated services.

… updating input types

- Removed `cardBlockCreate` and `cardBlockUpdate` mutations from `api-journeys` schema.
- Updated `adminJourney` query to align with modern API structure.
- Refactored `DateTimeFilter` input type for better clarity and usage.
- Adjusted various GraphQL types to ensure consistency across schemas.
- Cleaned up unused imports and types in resolver files to enhance maintainability.
@mikeallisonJS mikeallisonJS requested a review from csiyang March 26, 2026 22:56
@mikeallisonJS mikeallisonJS self-assigned this Mar 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2dfaec83-1301-4b73-b0e6-be91e4486c7f

📥 Commits

Reviewing files that changed from the base of the PR and between 4936a96 and d302f74.

⛔ Files ignored due to path filters (1)
  • apis/api-journeys/src/app/__generated__/graphql.ts is excluded by !**/__generated__/**
📒 Files selected for processing (3)
  • apis/api-gateway/schema.graphql
  • apis/api-journeys-modern/schema.graphql
  • apis/api-journeys/schema.graphql
💤 Files with no reviewable changes (1)
  • apis/api-journeys/schema.graphql
✅ Files skipped from review due to trivial changes (1)
  • apis/api-journeys-modern/schema.graphql

Walkthrough

This pull request restructures GraphQL Federation routing across multiple services by moving field implementations between the api-journeys and api-journeys-modern graphs. It relocates cardBlockUpdate, iconBlockCreate, and adminJourney to api-journeys-modern, removes @override directives from several mutations and queries, and removes the corresponding implementations and tests from api-journeys.

Changes

Cohort / File(s) Summary
API Gateway Federation Routing
apis/api-gateway/schema.graphql
Re-ordered and re-scoped Mutation and Query fields with updated @join__field directives. Added override directives for cardBlockUpdate and iconBlockCreate routing to api-journeys-modern, removed overrides from buttonBlockCreate, buttonBlockUpdate, and journeyProfileUpdate. Relocated adminJourney with override directive.
API Journeys-Modern Schema
apis/api-journeys-modern/schema.graphql
Removed @override(from: "api-journeys") directives from buttonBlockCreate, buttonBlockUpdate, journeyProfileUpdate mutations and getUserRole query; field signatures otherwise unchanged.
API Journeys-Modern Override Configuration
apis/api-journeys-modern/src/schema/block/button/..., apis/api-journeys-modern/src/schema/block/card/..., apis/api-journeys-modern/src/schema/journeyProfile/..., apis/api-journeys-modern/src/schema/userRole/...
Removed override configuration from buttonBlockCreate.mutation.ts, buttonBlockUpdate.mutation.ts, journeyProfileUpdate.mutation.ts, and getUserRole.query.ts; repositioned override in cardBlockCreate.mutation.ts.
API Journeys Schema Removal
apis/api-journeys/schema.graphql, apis/api-journeys/src/app/modules/.../...graphql
Removed adminJourney query and cardBlockUpdate, iconBlockCreate mutations from extended Query/Mutation types; deleted corresponding input types CardBlockUpdateInput and IconBlockCreateInput.
API Journeys Resolver Removal
apis/api-journeys/src/app/modules/journey/journey.resolver.ts, apis/api-journeys/src/app/modules/block/card/card.resolver.ts, apis/api-journeys/src/app/modules/block/icon/icon.resolver.ts
Removed resolver implementations for adminJourney, cardBlockUpdate, and iconBlockCreate; includes deletion of CASL authorization guards, Prisma queries, and error handling logic.
API Journeys Test Cleanup
apis/api-journeys/src/app/modules/journey/journey.resolver.spec.ts, apis/api-journeys/src/app/modules/block/card/card.resolver.spec.ts, apis/api-journeys/src/app/modules/block/icon/icon.resolver.spec.ts
Removed test suites for adminJourney (4 tests), cardBlockUpdate (multiple auth/validation tests), and iconBlockCreate (creation and authorization tests); simplified test module providers.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • csiyang
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title partially describes the main changes but is incomplete due to truncation; it mentions removing deprecated fields but doesn't specify which ones or what the full scope entails. Complete the title to clearly specify the main changes, such as 'refactor: streamline GraphQL schema by removing deprecated block mutations and adminJourney query' to be more informative.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 00-00-MA-chore-modern-override-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

Warnings
⚠️ ❗ Big PR (697 changes)

(change count - 697): Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.

Generated by 🚫 dangerJS against d302f74

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Mar 26, 2026

View your CI Pipeline Execution ↗ for commit d302f74

Command Status Duration Result
nx run journeys-admin-e2e:e2e ✅ Succeeded 35s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 29s View ↗
nx run watch-e2e:e2e ✅ Succeeded 24s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 6s View ↗
nx run resources-e2e:e2e ✅ Succeeded 21s View ↗
nx run player-e2e:e2e ✅ Succeeded 3s View ↗
nx run short-links-e2e:e2e ✅ Succeeded 9s View ↗
nx run-many --target=vercel-alias --projects=jo... ✅ Succeeded 2s View ↗
Additional runs (20) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-04-07 21:14:02 UTC

@github-actions github-actions Bot temporarily deployed to Preview - journeys March 26, 2026 22:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin March 26, 2026 22:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin March 26, 2026 22:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player March 26, 2026 22:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 26, 2026 22:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - short-links March 26, 2026 22:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch March 26, 2026 22:58 Inactive
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
player ✅ Ready player preview Wed Apr 8 08:59:53 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
short-links ✅ Ready short-links preview Wed Apr 8 09:00:03 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Wed Apr 8 09:00:45 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Wed Apr 8 09:01:10 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
resources ✅ Ready resources preview Wed Apr 8 09:01:33 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Wed Apr 8 09:01:58 NZST 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Wed Apr 8 09:02:28 NZST 2026

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apis/api-journeys-modern/schema.graphql (1)

1348-1355: ⚠️ Potential issue | 🟠 Major

Remove the stale api-journeys overrides that now point to non-existent fields.

apis/api-journeys/schema.graphql no longer exposes cardBlockUpdate or adminJourney, but the modern schema still marks those fields with @override(from: "api-journeys") at lines 1355 and 1737. These stale directives will break Apollo Federation composition and routing, since the override source fields no longer exist.

Suggested SDL fix
   cardBlockUpdate(
     id: ID!
     input: CardBlockUpdateInput!

     """drop this parameter after merging teams"""
     journeyId: ID
-  ): CardBlock! `@override`(from: "api-journeys")
+  ): CardBlock!
@@
-  adminJourney(id: ID!, idType: IdType = slug): Journey! `@override`(from: "api-journeys")
+  adminJourney(id: ID!, idType: IdType = slug): Journey!
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apis/api-journeys-modern/schema.graphql` around lines 1348 - 1355, The schema
contains stale `@override` directives referencing removed fields in the other
service; remove the obsolete `@override`(from: "api-journeys") annotations from
the CardBlock mutations (cardBlockUpdate) and the adminJourney field so the
modern schema no longer points to non-existent sources — locate the occurrences
of the `@override` directive on cardBlockUpdate and adminJourney in the SDL and
delete those `@override`(from: "api-journeys") annotations, leaving the fields
defined locally in the modern schema.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apis/api-journeys-modern/schema.graphql`:
- Around line 1348-1355: The schema contains stale `@override` directives
referencing removed fields in the other service; remove the obsolete
`@override`(from: "api-journeys") annotations from the CardBlock mutations
(cardBlockUpdate) and the adminJourney field so the modern schema no longer
points to non-existent sources — locate the occurrences of the `@override`
directive on cardBlockUpdate and adminJourney in the SDL and delete those
`@override`(from: "api-journeys") annotations, leaving the fields defined locally
in the modern schema.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ca05109d-dd45-4a0b-bc60-e4dfccf302a8

📥 Commits

Reviewing files that changed from the base of the PR and between 37b123f and 3188554.

⛔ Files ignored due to path filters (52)
  • apis/api-journeys/src/__generated__/graphql.ts is excluded by !**/__generated__/**
  • apis/api-journeys/src/app/__generated__/graphql.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/BlockActionDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/BlockDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/BlockDeleteForCoverImage.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/BlockOrderUpdate.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CardCtaDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CardFormDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CardIntroDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CardPollDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CardQuoteDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CardVideoDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CardVideoRestore.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CoverBlockDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/CoverBlockRestore.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/DuplicatedBlock.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/GetStepBlocksWithPosition.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/JourneyAiTranslateCreateSubscription.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/JourneyImageBlockDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/MenuBlockDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/MultiselectWithButtonDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/MultiselectWithButtonRestore.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/NewBlock.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/PosterImageBlockDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/PosterImageBlockRestore.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/RadioOptionImageDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/RadioOptionImageRestore.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/RestoredBlock.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockCreateFromAction.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockCreateFromSocialPreview.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockDeleteFromAction.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockDeleteFromActionWithoutAction.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockDeleteFromSocialPreview.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockDeleteFromStep.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockRestoreFromAction.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/StepBlockRestoreFromSocialPreview.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/TestJourney.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/TextResponseWithButtonDelete.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/TranslatedJourney.ts is excluded by !**/__generated__/**
  • apps/journeys-admin/__generated__/globalTypes.ts is excluded by !**/__generated__/**
  • apps/journeys/__generated__/JourneyAiTranslateCreateSubscription.ts is excluded by !**/__generated__/**
  • apps/journeys/__generated__/TranslatedJourney.ts is excluded by !**/__generated__/**
  • apps/journeys/__generated__/globalTypes.ts is excluded by !**/__generated__/**
  • apps/resources/__generated__/JourneyAiTranslateCreateSubscription.ts is excluded by !**/__generated__/**
  • apps/resources/__generated__/TranslatedJourney.ts is excluded by !**/__generated__/**
  • apps/resources/__generated__/globalTypes.ts is excluded by !**/__generated__/**
  • apps/watch/__generated__/JourneyAiTranslateCreateSubscription.ts is excluded by !**/__generated__/**
  • apps/watch/__generated__/TranslatedJourney.ts is excluded by !**/__generated__/**
  • apps/watch/__generated__/globalTypes.ts is excluded by !**/__generated__/**
  • libs/journeys/ui/__generated__/globalTypes.ts is excluded by !**/__generated__/**
  • libs/journeys/ui/src/libs/useJourneyAiTranslateSubscription/__generated__/JourneyAiTranslateCreateSubscription.ts is excluded by !**/__generated__/**
  • libs/journeys/ui/src/libs/useJourneyAiTranslateSubscription/__generated__/TranslatedJourney.ts is excluded by !**/__generated__/**
📒 Files selected for processing (16)
  • apis/api-gateway/schema.graphql
  • apis/api-journeys-modern/schema.graphql
  • apis/api-journeys-modern/src/schema/block/button/buttonBlockCreate.mutation.ts
  • apis/api-journeys-modern/src/schema/block/button/buttonBlockUpdate.mutation.ts
  • apis/api-journeys-modern/src/schema/block/card/cardBlockCreate.mutation.ts
  • apis/api-journeys-modern/src/schema/journeyProfile/journeyProfileUpdate.mutation.ts
  • apis/api-journeys-modern/src/schema/userRole/getUserRole.query.ts
  • apis/api-journeys/schema.graphql
  • apis/api-journeys/src/app/modules/block/card/card.graphql
  • apis/api-journeys/src/app/modules/block/card/card.resolver.spec.ts
  • apis/api-journeys/src/app/modules/block/card/card.resolver.ts
  • apis/api-journeys/src/app/modules/block/icon/icon.resolver.ts
  • apis/api-journeys/src/app/modules/journey/journey.graphql
  • apis/api-journeys/src/app/modules/journey/journey.resolver.spec.ts
  • apis/api-journeys/src/app/modules/journey/journey.resolver.ts
  • apis/api-media/schema.graphql
💤 Files with no reviewable changes (10)
  • apis/api-journeys-modern/src/schema/block/card/cardBlockCreate.mutation.ts
  • apis/api-journeys-modern/src/schema/userRole/getUserRole.query.ts
  • apis/api-journeys-modern/src/schema/journeyProfile/journeyProfileUpdate.mutation.ts
  • apis/api-journeys/src/app/modules/journey/journey.graphql
  • apis/api-journeys-modern/src/schema/block/button/buttonBlockCreate.mutation.ts
  • apis/api-journeys/src/app/modules/block/icon/icon.resolver.ts
  • apis/api-journeys-modern/src/schema/block/button/buttonBlockUpdate.mutation.ts
  • apis/api-journeys/src/app/modules/journey/journey.resolver.ts
  • apis/api-journeys/src/app/modules/block/card/card.graphql
  • apis/api-journeys/src/app/modules/journey/journey.resolver.spec.ts

…n API alignment

- Reintroduced `iconBlockCreate` mutation in `api-gateway` and `api-journeys` schemas with updated input type.
- Removed deprecated `iconBlockCreate` definitions from previous locations.
- Ensured consistency in `IconBlockCreateInput` across schemas.
- Cleaned up related resolver files by removing unused imports and tests for the removed mutation.
@github-actions github-actions Bot temporarily deployed to Preview - watch March 26, 2026 23:22 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys March 26, 2026 23:22 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player March 26, 2026 23:22 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - short-links March 26, 2026 23:22 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin March 26, 2026 23:22 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin March 26, 2026 23:22 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 26, 2026 23:22 Inactive
@stage-branch-merger
Copy link
Copy Markdown
Contributor

Merge conflict attempting to merge this into stage. Please fix manually.

@github-actions github-actions Bot temporarily deployed to Preview - player March 31, 2026 01:56 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - videos-admin March 31, 2026 01:56 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch March 31, 2026 01:56 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources March 31, 2026 01:56 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys March 31, 2026 01:56 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - short-links March 31, 2026 01:56 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin March 31, 2026 01:56 Inactive
@blacksmith-sh

This comment has been minimized.

@github-actions github-actions Bot temporarily deployed to Preview - videos-admin April 7, 2026 20:57 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - player April 7, 2026 20:57 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys April 7, 2026 20:57 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - resources April 7, 2026 20:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - watch April 7, 2026 20:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - journeys-admin April 7, 2026 20:58 Inactive
@github-actions github-actions Bot temporarily deployed to Preview - short-links April 7, 2026 20:58 Inactive
@mikeallisonJS mikeallisonJS enabled auto-merge April 7, 2026 21:43
@mikeallisonJS mikeallisonJS added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit 4843222 Apr 7, 2026
39 checks passed
@mikeallisonJS mikeallisonJS deleted the 00-00-MA-chore-modern-override-cleanup branch April 7, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants