Each program has a graph which is how you interact with it.
A program's graph is defined by a schema defined in
The schema is a set of types, each of which define fields, actions, and events.
Schemas are required to have a
Root type which defines the type of the program's "root
node". This node serves as the entry point into the program, all references are relative to the root node.
Nodes are referred to by the program's name followed by a colon and then a path to the node from the
Root type. For example:
github:refers to the root node of the github driver
twitter:refers to the root node of the twitter driver
github:users.one(name:"membrane-io")referes to a Github
github:users.one(name:"membrane-io").repos.one(name:"directory")referes to a Github
Types can define fields, which represent values which can be read from it. Continuing with more examples from the github driver:
github:statusfield of type
statusfield of the
github:usersfield of type
usersfield of the
github:users.one(name:"membrane-io")refers to a node of type
github:users.one(name:"juancampa")refers to another node of type
From the two last examples, you can see that parameters can be passed to fields, and each combination of parameters represent a different graph node.
We call these references "handles" or "grefs" (short for graph reference).
Types can also define actions. Which are essentially functions that can be invoked in the context of a graph node. Importantly, actions are graph nodes as well so they can be passed around and referenced just like fields.
Programs can subscribe an action to handle an event. When an event is emitted, the action will be invoked with an
additional parameter called