To make efficient lookups, Pathom uses a series of indexes generated from the user resolvers.
This is the most important index to understand how Pathom processes the data.
oir stands for
In other words, this is the index that tells Pathom which are the paths available to reach a given attribute in the system.
Let's look at an example and talk over it:
With this index, Pathom can ask: How can I fetch
:acme.product/price in the system?
For which the answer is:
Or in plain english: The index says you can fetch the product price, given you provide some
product id, using the edge
The input in this index uses the shape descriptor format.
This is an overview of this index, for more details on how the planner uses it, check the planner page.
This index tells, for given attribute set (with empty, one or more items), which attributes are directly reachable (one resolver distance) from that set.
io stands for
Here is what
index-io looks like, using the same resolver from our previous example:
output part uses the shape descriptor format.
Smart maps use this index to figure reachable attributes when used in "reachable mode".
This is a good index to create auto-complete features in editors for Pathom integration.
This index contains accumulated information about how a specific attribute relates to other attributes and resolvers.
Let's use the
full-name resolver example to demonstrate the index-attributes at play:
The first level of the index is the attribute itself, the details we can explain key by key:
Contains the ID of the attribute, it may be a keyword (as seen in the example) or also a set in cases of attribute combinations.
A set containing a list of all resolvers in which this attribute appears as an input.
A set containing a list of all resolvers in which this attribute appears as an output.
This is a sub-index, telling what other attributes are reachable from this attribute, by which resolver.
This is a sub-index, telling what other attributes you can use to reach the current, by which resolver.
A set with all the input combinations that this attribute appears in.
In this index you can lookup resolvers by their name. Using both
full-name resolvers, this is what the
index-resolvers looks like: