跳至主要内容

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, and VerifyPlayerNode.
  • PageGraphAddPageBlockNode, ConditionNode, and SplitNode.
  • SegmentGroupGraphAddToSegmentNode, RemoveFromSegmentNode, SetAttributeValuesNode, ConditionNode, and SplitNode.

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

ResourceChange
create_campaign, update_campaigngraph now uses CampaignGraph; AddPageBlockNode and the store and payment risk nodes no longer accepted in graph.nodes
get_campaign_graph, update_campaign_graphRequest and response now use CampaignGraph instead of GraphRoot
update_segment_groupgraph 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_pageDynamicBlock.graph_rules now uses PageGraph, limited to AddPageBlockNode, ConditionNode, and SplitNode
ComponentsRemoved the GraphRoot schema; added CampaignGraph, PageGraph, and SegmentGroupGraph

Upgrade

  • Regenerate clients. Code typed against GraphRoot needs 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.

需要技术支持?
联系我们的集成技术团队: integration@aghanim.com