modelsfolder: objects compatible with the
@aragon/connectAPI. This is what the consumers of your app connector are going to interact with.
thegraphfolder: a connector implementation for The Graph which uses
@aragon/connect-thegraphto perform GraphQL queries, parse them and present the result in the form of models objects. This part is only used internally, and
connector.tscontains the methods responsible to fetch the app data from The Graph.
index.tsto pick which models and objects are exposed to other packages.
thegraph/connector.ts(assuming your connector is using The Graph), add functions that the models of your connector will use. For example, the
@aragon/connect-votingwill call its
castsForVote(...): Promise<Cast>function. These functions all follow the same structure of (1) performing a query, (2) parsing the results of a query, and (3) wrapping and returning the results in the appropriate model.
subgraphfolder, you’ll find a separate project which defines the Subgraph which the connector implementation uses as its data source.
createAppConnector(), which takes care of doing some necessary checks as well as passing contextual information to the callback.
connectVotinggot returned by
connect(). It is indicative: app connectors can use it to use the same mechanism on their side. For now, it can only be
connect(). App connectors should follow it or throw an error, as connecting to a different network will create unexpected results.
connect(). It is indicative and app connectors might choose to ignore it.
createAppConnector(), called by app authors. It takes these parameters:
"thegraph"). In its array form, it also accepts a configuration object that gets passed to your connector.
Do you have a question? Leave your comments here at our Discourse forum 👇