Building a Simple GraphQL IDE Extension
📖 Scenario: You are creating a simple GraphQL IDE extension that helps users by storing and managing a list of saved GraphQL queries. This will simulate a small database of queries inside the extension.
🎯 Goal: Build a small in-memory database structure to hold saved GraphQL queries, add a configuration for maximum saved queries, implement a function to add queries only if under the limit, and finalize the extension setup with a metadata object.
📋 What You'll Learn
Create a dictionary called
savedQueries with three exact entries: "GetUser": "query { user { id name } }", "ListPosts": "query { posts { id title } }", and "GetComments": "query { comments { id content } }".Add a variable called
maxQueries and set it to 5.Write a function called
addQuery that takes name and query parameters and adds the query to savedQueries only if the number of saved queries is less than maxQueries.Create a final object called
extensionMetadata with keys name set to "SimpleGraphQLIDE" and version set to "1.0.0".💡 Why This Matters
🌍 Real World
GraphQL IDE extensions often need to store user queries for quick access. This project simulates managing such a small database inside the extension.
💼 Career
Understanding how to manage data storage and configuration in extensions or applications is a key skill for software developers working with developer tools or IDE plugins.
Progress0 / 4 steps