Tailflow
Skip to article
Browse documentation

The Graph · Action

Look up an entity

Finds one entity in a subgraph by its id and hands on the fields you name, without writing a query.

When to use it

Reading a token's or a pool's record in a subgraph when the event names it.

At a glance

IntegrationThe Graph
Credits1
ConnectionThe Graph, by pasting a key

Settings

subgraphRequired
Subgraph. The subgraph's id, as Graph Explorer shows it.
entityRequired
Entity. The entity's name, as the subgraph's schema spells it.
idRequiredAccepts event fields
ID. The entity's id, usually from the event. An address is lowercased, as subgraphs store them.
fieldsRequired
Fields. Separated by commas. Use a dot to reach into a related entity, such as owner.id.

What it hands on

Actions run in order, and each one can read what the actions above it produced. This one writes the fields below; a later action reaches them as {{ actions.graph_entity_1.entity }} — the action’s key, then which one it is if you use more than one of the same kind.

entity
The entity's fields by name, for example entity.symbol. Empty when it was not found.
found
True when the subgraph has an entity with that id.
truncated
True when the entity was too large and lists in it were shortened.

Good to know

  • An id the subgraph does not have is not a failure: the step completes with found set to false.
  • An entity or a field the subgraph does not have stops the flow, because every event would fail the same way.
  • Each lookup is billed to your key by The Graph.