The Fairmint Ethereum subgraph index data from the CAFE and the whitelist contracts deployed by Fairmint on Ethereum.
All subgraphs are deployed on the decentralized network:
The subgraph can be queried directly from the graph explorer, or from another application.
Get all the information about an organization with its id identifier.
{
organizations(where: {id: "<ORGANIZATION-ID"}) {
id
address
name
symbol
initGoal
initReserve
equityCommitment
fundraisingGoal
totalSupply
beneficiary
buySlopeNum
buySlopeDen
stakeholdersPoolIssued
stakeholdersPoolAuthorized
shareholders
minInvestment
whitelist
control
state
version
decimals
currency
}
}
Get all the information about a user with its id identifier.
{
users(where: {id: "<USER-ID"}) {
id
address
invested
received
totalTokensLocked
startIndex
endIndex
jurisdictionId
organizationName
organizationAddress
whitelistContractAddress
}
}
- Install Graph CLI
yarn global add @graphprotocol/graph-cli
Update package.json with the slug of your subgraph on Subgraph Studio.
- Code generation for the subgraph
yarn codegen
- Build the subgraph and check compilation errors
yarn build
- Authentification
graph auth --studio '<ACCESS_TOKEN>'
- Deployment
yarn deploy
If there is an error while indexing the subgraph, it may not be displayed in the Explorer logs.
You can query the health of your subgraph as shown here.