Skip to content

MPDX-9703 Fix Google Calendar sync for To Do / Letter-Card activity types#1831

Open
jbirdjavi wants to merge 1 commit into
mainfrom
MPDX-9703_google_cal_activity_type_enum
Open

MPDX-9703 Fix Google Calendar sync for To Do / Letter-Card activity types#1831
jbirdjavi wants to merge 1 commit into
mainfrom
MPDX-9703_google_cal_activity_type_enum

Conversation

@jbirdjavi

Copy link
Copy Markdown

Summary

Turning on Google Calendar sync for tasks of certain activity types throws a graphql-js error and blocks sync:

Enum "ActivityTypeEnum" cannot represent value: "INITIATION_TO_DO"
Enum "ActivityTypeEnum" cannot represent value: "FOLLOW_UP_LETTER_CARD"
Enum "ActivityTypeEnum" cannot represent value: "PARTNER_CARE_LETTER_CARD"
Enum "ActivityTypeEnum" cannot represent value: "FOLLOW_UP_TO_DO"

Root cause

The Google integration is a REST endpoint in mpdx_api, which this app stitches into GraphQL as its own subgraph. That subgraph keeps a hand-maintained copy of ActivityTypeEnum in googleAccountIntegrations.graphql, and it drifted out of sync with the canonical enum when the To Do and Letter/Card activity types were added (mpdx_api, March 2025).

GoogleAccountIntegration.calendarIntegrations: [ActivityTypeEnum!]! is resolved against this incomplete enum. parse.ts uppercases the REST values (follow_up_to_doFOLLOW_UP_TO_DO), and graphql-js then fails to serialize them against the subgraph enum that's missing those values.

The merged client schema (src/graphql/schema.graphql, types.generated.ts) already had all values, which is why this hid for so long. The runtime subgraph schema is built from this typedef alone, so it threw.

Change

Add the four missing values to the subgraph ActivityTypeEnum so it matches the canonical list:

  • FOLLOW_UP_LETTER_CARD
  • FOLLOW_UP_TO_DO
  • INITIATION_TO_DO
  • PARTNER_CARE_LETTER_CARD

The subgraph enum is now byte-identical to src/graphql/schema.graphql. No codegen artifacts change (they were already complete from the merged schema).

Follow-up

Longer term, this enum should be sourced from the shared schema rather than maintained as a second hand-written copy, to prevent future drift.

Jira: MPDX-9703 (surfaced during QA of MPDX-8537)

🤖 Generated with Claude Code

…ctivityTypeEnum

The Google Calendar integration subgraph maintains its own copy of
ActivityTypeEnum. It drifted out of sync with the canonical enum when the
To Do and Letter/Card activity types were added, so turning on calendar
sync for tasks of those types threw "Enum ActivityTypeEnum cannot represent
value" from graphql-js. Add the four missing values to restore parity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against 55ac2c0

No significant changes found

@jbirdjavi jbirdjavi requested a review from canac June 10, 2026 02:19

@canac canac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Is there an account we can impersonate and test this on?

@jbirdjavi

Copy link
Copy Markdown
Author

@canac Scott Mitchell said he encountered it on staging.

@canac canac added the Preview Environment Add this label to create an Amplify Preview label Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@canac

canac commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

I'm having trouble reproducing the issue and proving the fix works, but I trust you. And I know we want those two enum definitions to be sychronized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Preview Environment Add this label to create an Amplify Preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants