Query Examples
Common GraphQL queries for fetching data from Kleros subgraphs.V2 Core Queries (Arbitrum)
Always use the decentralized network endpoint for production queries. Get the subgraph ID from the Studio pages listed in Subgraph Endpoints and construct the URL as
https://gateway.thegraph.com/api/{API_KEY}/subgraphs/id/{SUBGRAPH_ID}.Fetch Courts
Key fields:minStake (in wei), feeForJuror (juror reward per vote), timesPerPeriod (array of 4 phase durations in seconds).
Fetch Recent Disputes
Key fields:externalDisputeID (your app’s ID), templateId (links to DisputeTemplateRegistry), ruled (finalized), currentRuling (active ruling option).
Fetch Dispute by External ID
UseexternalDisputeID to correlate an on-chain dispute with your app’s internal ID (emitted in DisputeRequest):
Fetch Juror Stakes for a Specific Address
Fetch Juror’s Active Draws
Curate Queries (V1)
Fetch Registered Items from a Light Curate List
Fetch Items in Challenge Period
Fetch Item Details with Request History
<itemID>@<listAddress>:
Address Tag Registries (Gnosis Chain)
Batched query to fetch address tags from the three Kleros address tag registries on Gnosis Chain:https://thegraph.com/hosted-service/subgraph/kleros/legacy-curate-xdai
Proof of Humanity
Check Registration Status
isRegistered(address) directly on the PoH contract at 0xC5E9dDebb09Cd64DfaCab4011A0D5cEDaf7c9BDb.
Tips
- Addresses must be lowercase in all queries. The subgraph stores them as bytes and does not understand checksummed addresses.
- Items with status
ClearingRequestedare still registered until the removal request is finalized. Include them when fetching “active” items. - The Graph hosted service has a 1000 item limit per query. For registries with more items, paginate using
skiporid_gt. - Light Curate entities are prefixed with
l(e.g.,litems,lrequests). Classic Curate uses unprefixed entities (items,requests).
Further Reading
Subgraph Endpoints
Full list of subgraph URLs
Light Curate Integration
Full Light Curate developer guide