Home / Companies / OpsMill / Blog / May 2025

May 2025 Summaries

3 posts from OpsMill

Filter
Month: Year:
Post Summaries Back to Blog
GraphQL fragments and variables significantly enhance the flexibility, maintainability, and type-safety of queries, allowing developers to create dynamic queries that adapt to various inputs without altering the query structure. Variables eliminate hardcoded values by using placeholders that are assigned at runtime, enhancing security, reusability, and code clarity, particularly in scenarios requiring filtering or user input adaptability. Fragments, on the other hand, prevent query repetition and are especially useful when dealing with polymorphic types, enabling conditional requests for fields based on runtime types, which simplifies querying for diverse data models. The guide highlights how to implement these features using Postman for testing live data, offering a practical approach without needing a full development environment. Additionally, Infrahub provides a nuanced approach to GraphQL syntax, further empowering users to execute precise and maintainable data queries, as demonstrated by CEO Damien Garros in an accompanying video tutorial.
May 12, 2025 936 words in the original blog post.
GraphQL is a powerful query language developed by Facebook, now maintained by the GraphQL Foundation, that provides network engineers with fine-grained control over data retrieval and modification, particularly useful in the context of programmable, API-driven networks. Unlike traditional REST APIs, which require multiple endpoints and can lead to over-fetching or under-fetching of data, GraphQL allows users to send a single query to obtain exactly the information they need, making it especially beneficial for complex network topologies and large telemetry datasets. The guide provides an overview of GraphQL basics, including queries, mutations, and filters, and highlights the advantages of using GraphQL over REST, such as reduced data fetching, simplified scripting, and improved performance. Network engineers familiar with GraphQL can efficiently automate scripts, dashboards, and troubleshooting workflows on platforms like Cisco DNA Center, Juniper Apstra, and Infrahub, which offer GraphQL APIs. The guide also provides practical examples of how to perform GraphQL queries and mutations, emphasizing the language's schema-driven nature, which allows highly targeted queries without post-processing results. By mastering GraphQL, engineers can streamline data access and automation, saving both time and effort in managing network infrastructures.
May 09, 2025 1,099 words in the original blog post.
The Infrahub Python SDK provides a comprehensive interface for programmatically managing data within Infrahub by allowing users to query, create, modify, delete, and upsert various data nodes such as devices, VLANs, and sites. The SDK operates through a client object that can be set up with an API token from the Infrahub demo instance, which resets daily, ensuring a fresh start for each session. Users can create nodes using the create() method, referencing schemas to understand required attributes and relationships, and save them into Infrahub. The SDK supports relationships of different cardinalities, allowing users to link nodes either directly or through IDs and Human-Friendly Identifiers (HFIDs). Updating nodes involves retrieving them, changing their attributes or relationships, and saving the changes, with features to handle both single and multiple relationship cardinalities. Deletion is straightforward, requiring retrieval followed by a delete() call. The SDK also facilitates upserting, which combines updating and inserting nodes, provided the schema includes an HFID for unique identification. The SDK encourages practical use through a sandbox environment and emphasizes the importance of secure API token management and the advantages of strict typing for enhanced development experience.
May 07, 2025 3,732 words in the original blog post.