GraphQL API¶
Every query is a POST /graphql request.
Schemas¶
Single schema¶
Get a schema's data by its schema ID.
Body Parameters:
# Write your query or mutation here
query getSchema {
schema(id: "onchain_evm_80001_0x3") {
id
mode
chainType
chainId
schemaId
transactionHash
name
description
revocable
maxValidFor
resolver
registerTimestamp
registrant
data
}
}
Response:
{
"data": {
"schema": {
"id": "onchain_evm_80001_0x3",
"mode": "onchain",
"chainType": "evm",
"chainId": "80001",
"schemaId": "0x3",
"transactionHash": "0x73a6b43255ada4b165b55477f34fa4baa44d9090e6ecb6a145274e15ae0865b6",
"name": "message",
"description": "",
"revocable": true,
"maxValidFor": 0,
"resolver": "0x0000000000000000000000000000000000000000",
"registerTimestamp": 1705484022,
"registrant": "0x9854E76134e6D729A633CED51042fF653f04f4C5",
"data": "[{\"name\":\"message\",\"type\":\"string\"}]"
}
}
}
Filtered schemas¶
Query a list of schemas. You can filter, paginate, and order the results, among other standard GraphQL operations.
Body Parameters:
query querySchemas {
pagedSchemas(page: 1, size: 10) {
total
page
size
schemas {
id
mode
chainType
chainId
schemaId
transactionHash
name
description
revocable
maxValidFor
resolver
registerTimestamp
registrant
data
}
}
}
Response:
{
"data": {
"pagedSchemas": {
"total": 20,
"page": 1,
"size": 10,
"schemas": [
{
"id": "onchain_evm_7001_0x7",
"mode": "onchain",
"chainType": "evm",
"chainId": "7001",
"schemaId": "0x7",
"transactionHash": "0xabddd6fe182a75d61eb0feef028a71a24fbdf46e7508c519c099c9d8a5805801",
"name": "test",
"description": "whasa",
"revocable": true,
"maxValidFor": 0,
"resolver": "0x0000000000000000000000000000000000000000",
"registerTimestamp": 1705912991,
"registrant": "0xDfc4FbbDd9C47c7976fEBb14B1D37C7f85FE299D",
"data": "[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"count\",\"type\":\"number\"}]"
},
...
]
}
}
}
Attestations¶
Single attestation¶
Get an attestation's data by its attestation ID.
Body Parameters:
query getAttestation {
attestation(id: "onchain_evm_80001_0x1") {
# Write your query or mutation here
attestationId
attester
attestTimestamp
linkedAttestation
chainId
chainType
data
dataLocation
transactionHash
revokeTransactionHash
id
indexingValue
mode
recipients
revoked
revokeReason
revokeTimestamp
schema {
id
name
registrant
}
validUntil
}
}
Response:
{
"data": {
"attestation": {
"attestationId": "0x1",
"attester": "0x9854E76134e6D729A633CED51042fF653f04f4C5",
"attestTimestamp": 1705455448,
"linkedAttestation": "",
"chainId": "80001",
"chainType": "evm",
"data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033232320000000000000000000000000000000000000000000000000000000000",
"dataLocation": "ONCHAIN",
"transactionHash": "0x00ecb7e8c6d3ae6d0fab2432c1e7ccc3f1128716839c04b5b4a51457e9ce6eff",
"revokeTransactionHash": "",
"id": "onchain_evm_80001_0x1",
"indexingValue": "",
"mode": "onchain",
"recipients": [],
"revoked": false,
"revokeReason": null,
"revokeTimestamp": null,
"schema": {
"id": "onchain_evm_80001_0x1",
"name": "xxx",
"registrant": "0x9854E76134e6D729A633CED51042fF653f04f4C5"
},
"validUntil": 0
}
}
}
Filtered attestations¶
Query a list of attestations. You can filter, paginate, and order the results, among other standard GraphQL operations.
Body Parameters:
query queryAttestations {
pagedAttestations(page: 1) {
total
attestations {
attestationId
attester
attestTimestamp
linkedAttestation
chainId
chainType
data
dataLocation
transactionHash
revokeTransactionHash
id
indexingValue
mode
recipients
revoked
revokeReason
revokeTimestamp
schema {
id
schemaId
name
registrant
data
}
validUntil
}
}
}
Response:
{
"data": {
"pagedAttestations": {
"total": 52,
"attestations": [
{
"attestationId": "0x21",
"attester": "0x9854E76134e6D729A633CED51042fF653f04f4C5",
"attestTimestamp": 1706065910,
"linkedAttestation": "",
"chainId": "80001",
"chainType": "evm",
"data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000033232320000000000000000000000000000000000000000000000000000000000",
"dataLocation": "ONCHAIN",
"transactionHash": "0x0f0fb01c520add97a74d6125729053559c7cffb96a5f5871118b766e9a3ddbb7",
"revokeTransactionHash": "0x2e0cda7c6222190c5065df8c8164ee26aec6132c98320733b2775c923fcca634",
"id": "onchain_evm_80001_0x21",
"indexingValue": "0x059e6B8008d34aC26581fD3ED8378AA93c7941EE",
"mode": "onchain",
"recipients": [],
"revoked": true,
"revokeReason": "test revoke",
"revokeTimestamp": 1706065942,
"schema": {
"id": "onchain_evm_80001_0x1",
"schemaId": "0x1",
"name": "xxx",
"registrant": "0x9854E76134e6D729A633CED51042fF653f04f4C5",
"data": "[{\"name\":\"name\",\"type\":\"string\"}]"
},
"validUntil": 0
},
...
]
}
}
}