Graphs get a schema per context
What's new
The single GraphRoot schema shared by campaigns, pages, and segment groups is gone. Each context now has its own graph schema that accepts only the node types valid there:
CampaignGraph— the twenty campaign action nodes:ConditionNode,SplitNode,TimerNode,EmailActionNode,MobilePushActionNode,MobilePopupActionNode,BrowserPushNotificationActionNode,BrowserPopupNotificationActionNode,PWAPromptActionNode,WebhookActionNode,CreateItemBannerActionNode,CreateVirtualSKUNode,CreateUserStoreSettingsNode,CreateCouponNode,ItemAddNode,AddUserAchievementNode,AddToSegmentNode,RemoveFromSegmentNode,SetAttributeValuesNode, andVerifyPlayerNode.PageGraph—AddPageBlockNode,ConditionNode, andSplitNode.SegmentGroupGraph—AddToSegmentNode,RemoveFromSegmentNode,SetAttributeValuesNode,ConditionNode, andSplitNode.
The graph object itself is unchanged: same id, x, y, nodes, view_port, and the rest, with id, x, and y still required. Only the set of node types each graph will accept has narrowed.
Impact
The spec now rejects node types that the backend never ran in that context — an EmailActionNode inside a page's graph_rules, or an AddPageBlockNode inside a campaign graph. Generated clients get three graph models where they had one, and the node union on each is smaller.
Changes
| Resource | Change |
|---|---|
| create_campaign, update_campaign | graph now uses CampaignGraph; AddPageBlockNode and the store and payment risk nodes no longer accepted in graph.nodes |
| get_campaign_graph, update_campaign_graph | Request and response now use CampaignGraph instead of GraphRoot |
| update_segment_group | graph now uses SegmentGroupGraph, limited to the segment and attribute nodes plus ConditionNode and SplitNode |
| get_pages, get_page, create_page, update_page, bulk_update_page, translate_page | DynamicBlock.graph_rules now uses PageGraph, limited to AddPageBlockNode, ConditionNode, and SplitNode |
| Components | Removed the GraphRoot schema; added CampaignGraph, PageGraph, and SegmentGroupGraph |
Upgrade
- Regenerate clients. Code typed against
GraphRootneeds to switch to whichever of the three schemas matches the endpoint it calls. - Check any graph you build programmatically against the node list for its context. A node type that is no longer in the union will fail validation even though the same payload was accepted before.
- Some node types were dropped from the API entirely as part of this change — see Store sorting and payment risk nodes removed.
Need help?
Contact our integration team at [email protected]