# Schemas

### Single Schema

```typescript
POST / graphql;
```

Retrieve the data of a schema by querying with a schema ID.

Body Parameters:

```graphql
# 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:

```json
{
  "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

```typescript
POST / graphql;
```

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

Body Parameters:

```graphql
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:

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