LogoLogo
  • Sign Protocol
    • Introduction
    • FAQ
  • For Hackers
    • Getting Started
  • For Builders
    • Getting Started
      • Fundamentals
      • Tutorials
        • Building a Simple Notary Platform
          • Schema Creation
          • Attestation Creation
          • Querying Attestations
          • Parsing Attestation Data
        • Delegate Attestation Creation
          • Express Backend
          • Solidity
      • Examples
        • Attestation Discord Bot
        • KYC-Gated Smart Contract Access Control
    • Supported Networks
    • Sign Developer Platform
    • Advanced Topics
      • Cross Chain Attestations
      • Hybrid Attestations
      • Schema Hooks
        • Tutorial: Checking Attestation Data
          • Schema Creation
          • Schema Hook
          • Creating an Attestation (Solidity)
      • ZK Attestations
        • Compile a Circuit
        • Create a Schema Hook
    • Querying Data
      • NPM SDK
        • Usage & Examples
      • REST APIs
        • Schemas
        • Attestations
      • GraphQL
        • Schemas
        • Attestations
    • Writing Data
      • NPM SDK
        • Installation
        • Usage
          • Schemas
          • Attestations
        • Examples
        • Changelog
      • Smart Contract
        • EVM
          • Interfaces
            • ISP
            • ISPHook
            • IVersionable
          • Data Models
            • Schema
            • Attestation
            • DataLocation
  • For Thinkers
    • A Future Of Verifiable Trust
    • Effective Attestations
    • Incentive-Aligned Public Good
    • Glossary
      • Attestations
      • Schema
      • Schema Registry
      • Attestation Repository
  • Case Study
    • EthSign
    • KYC-Gated Contract Calls
    • Proof of Audit
    • Developer Onchain Reputation
    • Onboarding Web2 Data
Powered by GitBook
LogoLogo

Copyright Sign 2021-2024

On this page
  • Single Schema
  • Filtered Schemas

Was this helpful?

  1. For Builders
  2. Querying Data
  3. GraphQL

Schemas

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

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

Last updated 10 months ago

Was this helpful?