SDK · Playground
Pick a recipe, hit Run to see the simulated output, or Open in StackBlitz to get a live Node.js environment with @unified-product-graph/sdk pre-installed and the recipe ready to edit and run.
Cookbook · Writing
Shallow-merge a patch onto an existing node. Persists on every call.
Code
import { UPGClient } from '@unified-product-graph/sdk'
const upg = new UPGClient({ file: './product.upg' })
const node = await upg.nodes.get('n_Kg19aubWwbwm7V5t')
if (!node) throw new Error('node not found')
const updated = await upg.nodes.update(node.id, {
status: 'active',
updated_at: new Date().toISOString(),
})
console.log('now:', updated.status, '@', updated.updated_at)Output
// click ▶ Run to see what this snippet would print locally