Querying a SDTF graph
Learn more about how to query your SDTF token graph.
Introduction
Your token system can be more complex than it seems. You will often need to interact with your token graph to transform a specific set of design tokens within a Specify configuration.
This article will help you understand how you can query your token graph to select a specific set of tokens.
Compatible parsers
Query structure
Every Query holds a single a where property being an object, to select one branch of the graph, or an array of objects, to select many branches of the graph (OR statement).
Type Query = { where: Where | Array<Where> }The where property splits in 3 kinds: token, group, collection - offering a dedicated set of options to match against the given kind.
The name property accepts a RegExp for a value. These resources will help you debug your regular expressions:
Where Token
Where Group
Where Collection
Use cases
Select tokens from a specific collection
Select tokens from several collections matching a naming pattern
Select tokens from a specific group
Select tokens of a specific type from a collection
Select all tokens from a collection and from groups matching a naming pattern
Select tokens from several groups with different names
Select design tokens from a specific type
Last updated
Was this helpful?