Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/graphql/courses/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ export const updateGroup = async ({
}

if (drip) {
if (drip.status) {
if (typeof drip.status === "boolean") {
$set["groups.$.drip.status"] = drip.status;
Comment on lines +861 to 862
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve drip.type when accepting status: false

Because DripInput.type is optional in apps/web/graphql/courses/types/index.ts:86-95 but Drip.type is non-null on reads at apps/web/graphql/courses/types/index.ts:97-103, this new branch can create a partial groups.$.drip object when a client sends updateGroup(..., drip: { status: false }) for a group that has never had drip configured. In that case the mutation stores drip.status without any drip.type, and subsequent reads of that group can fail with Cannot return null for non-nullable field Drip.type.

Useful? React with 👍 / 👎.

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.

Check if still valid as I applied the fix

Comment thread
rajat1saxena marked this conversation as resolved.
}
if (drip.type) {
Expand Down
Loading