Index Service

Index Service (GraphQL)

Get Single Schema

POST /graphql

Retrieve the data of a schema by querying with a 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\"}]"
        }
    }
}

Query Schemas

POST /graphql

Query for a list of schemas. Results can be filtered, paginated, ordered, etc. according to GraphQL standards.

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\"}]"
                },
                ...
            ]
        }
    }
}

Get Single Attestation

POST /graphql

Retrieve the data of an attestation by querying with an 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
        }
    }
}

Query Attestations

POST /graphql

Query for a list of attestations. Results can be filtered, paginated, ordered, etc. according to GraphQL standards.

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
                },
                ...
            ]
        }
    }
}

Last updated