Skip to content

Allow pinning altair-static package version via AltairOptions#1211

Open
ben-schmidt wants to merge 3 commits intographql-dotnet:masterfrom
ben-schmidt:allow-pinning-a-specific-Altair-version
Open

Allow pinning altair-static package version via AltairOptions#1211
ben-schmidt wants to merge 3 commits intographql-dotnet:masterfrom
ben-schmidt:allow-pinning-a-specific-Altair-version

Conversation

@ben-schmidt
Copy link
Copy Markdown

@ben-schmidt ben-schmidt commented Feb 18, 2026

This PR introduces the ability for users of graphql-dotnet to explicitly pin the version of altair-static used by the Altair UI integration.
Previously, the middleware always relied on loading the latest version of Altair from a CDN. While convenient, this caused a number of issues when upstream Altair releases introduced breaking changes or unexpected behavior—changes that were immediately reflected in running applications without any modification by the user.

Why This Matters

Relying on a moving/latest CDN target can result in:

  • Sudden UI breakages after upstream releases
  • Hard-to-debug regressions when the Altair team publishes updates
  • Inconsistent environments between development, testing, and production

By enabling version pinning, applications get:

  • Full control over the exact Altair version used
  • Stable and deterministic deployments
  • Separation between application updates and external frontend changes

What This PR Does

  • Adds support for specifying the exact altair-static version to load
  • Falls back to the previous CDN behavior when no version is specified
  • Keeps the default experience simple while giving advanced users control and stability
app.UseGraphQLAltair(new AltairOptions
{
    AltairVersion = "8.5.1"; // Pin a specific version (optional parameter; if not set previous CDN behaviour is used)
});

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.21%. Comparing base (a84c553) to head (8a0e10c).
⚠️ Report is 42 commits behind head on master.

Files with missing lines Patch % Lines
src/Ui.Altair/Internal/AltairPageModel.cs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1211       +/-   ##
===========================================
- Coverage   90.88%   68.21%   -22.68%     
===========================================
  Files          50      123       +73     
  Lines        2425     4533     +2108     
  Branches      432      549      +117     
===========================================
+ Hits         2204     3092      +888     
- Misses        175     1343     +1168     
- Partials       46       98       +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants