Published on

An Inside Look at Three New WunderGraph Features for 2024

Authors
  • avatar
    Name
    Andrew Blase
    Twitter

Introduction

In the ever-evolving world of software development, staying ahead of the curve means embracing tools and features that enhance productivity and streamline processes. WunderGraph, a leader in GraphQL service management, continues to push the envelope with its latest innovations. Let's explore three new features of WunderGraph: Supergraph Previews, Graph Feature Flags, and Graph Pruning. These tools are designed not just to simplify workflows but also to empower teams to manage GraphQL services with unprecedented ease.

developer using restQL in confusion

Enhancing Collaboration with Supergraph Previews

In collaborative development environments, clear and early visibility of code changes can make all the difference. Hence why Supergraph Previews were created.

How It Works: Supergraph Previews allow developers to generate a fully functional preview of the proposed changes in a pull request. This means team members can see and interact with updates before they are merged into the main branch. The ability to validate changes in a real-world scenario reduces integration issues and fosters smoother collaboration. According to the Supergraph Previews tutorial, this feature integrates seamlessly with your existing CI/CD pipelines, ensuring that the development flow is uninterrupted and efficient.

Benefits:

  • Streamlined Testing: By previewing changes early, potential issues can be identified and resolved before they reach production. This early detection is crucial in maintaining the integrity of the codebase and ensuring high-quality releases.
  • Enhanced Collaboration: Teams no longer need to imagine how changes will integrate; they can see it in action, leading to more informed decision-making and better team alignment.

Creating a GitHub action is simple, such as below:

name: Cosmo Previews
on:
  pull_request:
    branches:
      - main
    types:
      - opened
      - reopened
      - closed
      - synchronize

jobs:
  create:
    runs-on: ubuntu-latest
    if: github.event.action == 'opened' || github.event.action == 'reopened'
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20.10.0
          cache: npm

      - name: Install wgc
        run: npm i -g wgc@latest

      - name: Create Cosmo Previews
        uses: wundergraph/cosmo-previews@v0.1.0
        with:
          config_path: .github/cosmo.yaml
          create: true
          cosmo_api_key: ${{ secrets.COSMO_API_KEY }}
          github_token: ${{ secrets.GITHUB_TOKEN }}

Based on my own experience, I can attest that this will save a lot of time and make testing much easier and faster.

Read More about Previews Here.

Dynamic Management with Graph Feature Flags

Feature flags have long been a staple in agile development, offering a way to control the exposure of new features. They allow developers to toggle features on or off without needing to redeploy the entire application. It means you can safely test new functionalities with select user groups and gather feedback in real-time.

WunderGraph’s Graph Feature Flags bring this capability to GraphQL services, providing unparalleled flexibility. As described in the Feature Flags concept article, this feature empowers teams to manage the deployment of new features with greater precision and less risk.

Benefits:

  • Real-Time Adjustments: React quickly to user feedback by enabling or disabling features instantly. This agility allows for iterative development and rapid prototyping.
  • Controlled Rollouts: Gradually introduce features slowly over time to minimize risk and ensure stability, which is particularly valuable in environments where uptime and user experience are critical.
Screenshot of the WunderGraph feature flag diagram

Just think of how this new feature might transform your team's ability to innovate and iterate based on direct user input.

Read More about Feature Flags.

Optimizing Performance with Graph Pruning

When it comes to efficient GraphQL services, less is often more. Graph Pruning is WunderGraph’s answer to reducing complexity and optimizing performance by removing unused parts of the graph.

Why Pruning Matters: Over time, GraphQL schemas can grow unwieldy, impacting performance and complicating maintenance. Graph Pruning allows you to trim these schemas down to only what's necessary, ensuring faster and more efficient data delivery. The Graph Pruning guide highlights how this process not only boosts performance but also simplifies the architecture, making it easier to maintain and evolve.

Benefits:

  • Improved Efficiency: Lighten your APIs by only serving essential data, which can significantly speed up response times. This leads to a smoother and faster user experience.
  • Simplified Maintenance: By focusing on active parts of the graph, maintenance becomes more straightforward, reducing the technical debt and resources required for upkeep.
Before-and-after diagram of a GraphQL schema, showing the impact of pruning on performance

Optimizing your GraphQL services could lead to not only performance gains but also a more manageable API infrastructure.

Read More about Graph Pruning.

Conclusion

WunderGraph continues to push GraphQL innovation to the next level with features that enhance usability and promote efficient service management. Supergraph Previews, Graph Feature Flags, and Graph Pruning are not just about keeping up with the latest trends—they’re about setting new standards in how we approach GraphQL services.

As you explore these features, consider how they might fit into your workflows and improve your processes. We’re eager to hear about your experiences and insights. How useful do you find these features? Share your thoughts and join the conversation!

For more technical details, visit WunderGraph’s official documentation.

Get twice as much done with a fifth of the code.