The APIS Docs
HookDiscordContact Us
  • ☺️Hello, Web3!
  • ↔️About The APIS
    • Introduction
    • Core Team
    • Our Partners
  • 🤖Roadmap
  • 🍦Products
    • 🔍Hook
      • Get Started
        • Explore
        • Calendar
        • Collections Trending
        • Watch List
      • Twitter RSS
      • Chatting /w Community
    • ❄️Data Lake
  • 🤓Academy
    • On-Chain Glossary
      • NFT
      • DeFi
  • ℹ️$API Token Info
    • 🅰️$API Smart Contract Address
    • 🪙Token Economics
      • $API Token Utility
      • $API Token Distribution
      • Dune Analysis
      • Investors
      • FAQs
        • What is API?
        • How do APIs work?
        • What is the API token?
        • Why does API stand out?
        • What does API mean for the crypto industry?
    • 📈Get $API Token
    • ⬆️Listed Exchanges
  • 🤝Get In Touch
    • 🥰Contact Us
    • 🥰Join Us
    • ❓FAQ
  • 📖Docs
    • 🔐Security
      • 📄Security Report by Certik
    • 📄Terms & Conditions
    • 📑Privacy Policy
    • ℹ️Disclaimer
  • 📃Whitepaper
    • Whitepaper
      • 1️⃣1⃣ Background
        • 1.1 Background
        • 1.2 Introduction
      • 2️⃣2⃣ Architecture
        • 2.1 Message Propagation Protocol
        • 2.2 Message Formatting Overview
        • 2.3 APIS Core Contracts
        • 2.4 Governance Contract (GC)
        • 2.5 Dispute Resolution Contract (DRC) Factory
        • 2.6 Optimistic Rollup Contract
      • 3️⃣3⃣ Applications
        • 3.1IDs
        • 3.2 API Token
        • 3.3 Token Distribution, Community Ownership
      • 4️⃣4⃣ Discussion
      • 5️⃣5⃣ Appendix
        • 5.1 REST History and Analysis
        • 5.2 REST APIs in Practice
        • 5.3 Strengths and Weaknesses of REST
        • 5.4 GraphQL History and Analysis
        • 5.5 GraphQL as a ‘Fetching Tree’
        • 5.6 Anatomy of a GraphQL Request
        • 5.7Note on GraphQL Resolvers:
        • 5.8 Direct Comparison
        • 5.9 Weaknesses of GraphQL
      • 6️⃣6⃣ Bibliography
Powered by GitBook
On this page
Edit on GitHub
  1. Whitepaper
  2. Whitepaper
  3. 5⃣ Appendix

5.7Note on GraphQL Resolvers:

In GraphQL there is only one method of information propagation: the propagation of context through a sequence of resolvers. While this sounds complex, it simply means that when a client reaches the ‘image’ object in Figure 5.6.2 above, it understands the context that I am asking for the image associated with the user that has the id “10”. Every field has a resolver. For scalar fields, the resolver is responsible for returning the actual data that the client sees. For object fields, the resolver instead returns a hidden chunk of data that is forwarded along to the resolvers of the fields contained in the object; these resolvers obtain their parent object’s hidden data, the global context, and any arguments, using all of these values to produce the desired return value set.

Now that we have exhibited a GraphQL query, it is important to note that the response will mirror the structure of that query, as shown below:

{
      “data” : {
                “user” : {
                   “name” : “Satoshi Nakamoto”,
                   “nickname” : “Seb”,
                   “image” : {
                      “url” : “image_url”
                   }
                }
             }
           }

Figure 5.7.1: GraphQL Response

Previous5.6 Anatomy of a GraphQL RequestNext5.8 Direct Comparison

Last updated 3 years ago

📃
5️⃣