🏗ī¸Crafting and Structuring Queries

Unleash the Power of Safeloop Data with Custom Queries

In the world of decentralized data, flexibility and adaptability are paramount. With SafeLoop, you have the freedom to tailor your data queries to your specific needs. You can choose from a vast library of pre-built queries designed to cover a wide range of use cases or craft your own custom queries for a more personalized experience.

Utilizing Pre-built Queries

SafeLoop offers a rich library of pre-built queries, providing you with a diverse set of options for retrieving blockchain data. These queries are meticulously crafted to address common use cases in the decentralized network. Whether you're searching for information about token transfers, contract interactions, or user addresses, our pre-built queries have you covered.

To start using a pre-built query, you can simply select one from our collection, customize it if needed, and test it in the Query Playground. The Query Playground serves as a sandbox environment where you can experiment with your queries to ensure they meet your data requirements. Once you're satisfied with the results, you can seamlessly integrate the query into your decentralized application.

Creating Custom Queries

While our pre-built queries offer great versatility, we understand that some use cases might require unique data access patterns. That's where custom queries come in. SafeLoop empowers you to generate your own custom queries to fetch data that aligns precisely with your application's needs.

Creating a custom query involves crafting a GraphQL query using SafeLoop's schema definition. Here's a structured example of a query schema:

query {
  CustomData {
    CustomEvent {
      id
      data
    }
    fetchCustomData {
      id
      result
    }
  }
}

In this GraphQL query:

  • CustomData is the top-level object representing your custom data.

  • CustomEvent represents the event type CustomEvent with fields id and data.

  • fetchCustomData represents the function call fetchCustomData with fields id and result.

With this custom query schema, you can create queries tailored to your application's unique data requirements. Once you've defined your custom query, you can test it in the Query Playground, ensuring that it performs as expected.

SafeLoop's robust query capabilities enable you to access the precise data you need in a decentralized network, offering flexibility and adaptability to meet your application's demands.

Last updated