Updated API Documentation (After 16 March'23)
Archived API Documentation (Before 16 March'23)
// Fetch proposal title and description:
// Graphql Request:
query {
posts(where: {onchain_link: {onchain_proposal_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
}
}
}
// Fetch proposal title and description:
// Graphql Request:
query {
posts(where: {onchain_link: {onchain_referendum_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
}
}
}
// Fetch treasury title and description:
// Graphql Request:
query {
posts(where: {onchain_link: {onchain_treasury_proposal_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
onchain_treasury_proposal_id
onchain_motion_id
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
}
}
// Response:
{
"data": {
"posts": [
{
"title": "Encointer pre-launch expenses to become common good parachain",
"content": "Encointer ...",
"onchain_link": {
"proposer_address": "EyXct79ZDWdQfcSgJTG5texKM9wJj3quyh1ugPDVSkSt3Xm",
"onchain_treasury_proposal_id": 113,
"onchain_motion_id": 357
}
}
]
}
}
query {
posts(where: {onchain_link: {onchain_motion_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
onchain_motion_id
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
}
}